| Bytes | Lang | Time | Link |
|---|---|---|---|
| 024 | Arturo | 240523T110246Z | chunes |
| 045 | Google Sheets | 231123T212813Z | doubleun |
| 067 | JavaScript | 240523T045108Z | darrylye |
| 162 | brainfuck | 240522T192517Z | madeforl |
| 945 | Nibbles | 240522T213553Z | DLosc |
| 1785 | Nibbles | 240229T020607Z | Mike Buf |
| 004 | MathGolf | 240229T113413Z | Kevin Cr |
| 046 | Python 3 | 240227T214144Z | movatica |
| 004 | 05AB1E | 240227T221419Z | Matthew |
| 139 | Lua | 240227T212634Z | Ed The & |
| 005 | Pip | 231128T055119Z | Aiden Ch |
| 027 | Deadfish~ | 240216T181927Z | enzo |
| 026 | YASEPL | 240208T003318Z | madeforl |
| 112 | morsecco | 231124T102300Z | Philippo |
| 050 | Python 3 | 231125T113514Z | enzo |
| 065 | Python | 231128T141711Z | SectorCo |
| 027 | Knight v2 | 231128T061703Z | Aiden Ch |
| 009 | Pyth | 231126T191834Z | princesa |
| 010 | GolfScript | 231127T162924Z | lynn |
| 042 | C GCC | 231125T032628Z | Qaziquza |
| 035 | Kotlin | 231125T120534Z | enzo |
| 4830 | Scala | 231124T105822Z | 138 Aspe |
| 028 | Commodore BASIC | 231127T105739Z | Shaun Be |
| 004 | Japt | 231127T091714Z | Shaggy |
| 039 | Python | 231126T205812Z | Albert.L |
| 049 | Python 3 | 231125T183357Z | Mark Ran |
| 027 | jq | 231126T065051Z | manatwor |
| 022 | R | 231123T214853Z | Giuseppe |
| 023 | Haskell | 231125T172921Z | Emily |
| 041 | Acc!! | 231124T231800Z | DLosc |
| 027 | XPath 2 | 231124T124921Z | topskip |
| 023 | Bash | 231123T231742Z | Jonah |
| nan | CP1610 machine code | 231124T100850Z | Arnauld |
| 018 | Octave / MATLAB | 231123T233307Z | Luis Men |
| 1715 | x8664 machine code | 231124T081311Z | m90 |
| 014 | Retina | 231124T010711Z | Neil |
| 013 | Perl 5 | 231124T090841Z | Nahuel F |
| 071 | Python 3 | 231124T033426Z | benlodz |
| 009 | sclin | 231124T033109Z | Mama Fun |
| 014 | V vim | 231124T025532Z | tsh |
| 003 | Charcoal | 231123T211745Z | Neil |
| 025 | PowerShell Core | 231123T220734Z | user3141 |
| 049 | brainfuck | 231123T224732Z | Level Ri |
| 019 | Ruby | 231123T222609Z | Kirill L |
| 004 | Vyxal 3 | 231123T222317Z | Nick Ken |
| 006 | APL dzaima/APL | 231123T220136Z | Youserna |
| 025 | Various Languages | 231123T215742Z | ATaco |
| 011 | Uiua | 231123T215129Z | chunes |
| 004 | RProgN 2 | 231123T214755Z | ATaco |
Google Sheets, 45 bytes
=sort(replace(join(,char(row(65:90))),12,1,))
...or:
=sort(join(,char(row(65:89)+(11<row(1:25)))))
...or 46 bytes:
=join(,filter(char(row(65:90)),12<>row(1:26)))
These formulas are longer than their output.
JavaScript, 67 bytes
_=>Array.from({length:25},(_,x)=>(x+10+(x>10)).toString(36)).join``
brainfuck, 186 162 bytes
-24 bytes from managing data a little bit better
+>+>>>+>>+[<<------------[[-]+<<<<[>>>>+<<<<-]>>>>>++++++++[<++++++++>-]<-.[-]][-]+<[-]+<<<[-]+>[<+>>+>+>+<<<-]+>[<+>-]>>>>[-]>+++++[<+++++>-]<++<<<[>>>-<<<-]>>>]
this is my first time with brainfuck x3 very sloppy and probably really inefficient because this is the first time I've coded something like this with brainfuck
Nibbles, 9 nibbles (4.5 bytes)
-|@\$u"L"
Explanation
Inspired by Mike Bufardeci's Nibbles answer, but since most of it is different I thought I'd post it separately.
-|@\$u"L"
@ List of all printable ASCII characters
| Filter, keeping the ones that
\$u are uppercase letters
- "L" Remove L
Nibbles, 17 nibbles (8.5 bytes)
-.,26ch+64$"L"
Explanation
,26 # for i in range [1-26]
+64$ # add 64 to i
ch # convert i to char
-. "L" # concat all and remove "L"
# (implicitly print entire string)
Alternately, -.,26ch+96$"l" works for lowercase and has the same score.
MathGolf, 4 bytes
▄'l-
Explanation:
▄ # Push the lowercase alphabet
'l- '# Remove the "l"
# (after which the entire stack is output implicitly as result)
Python 3, 47 46 bytes
for i in range(65,90):print(end=chr(i+(i>75)))
Yet another boring loop in Python 3 :)
Lua, 139 bytes
p,c,l=io.write,string.char,{}for i=65,90 do if i~=76 then l[#l+1]=i end end for j=1,#l do p(c(l[j]))end p"\n"for k=1,#l do p(c(l[k]+32))end
Explanation
Lua allows us to reference functions, similar to pointers in C and C++. This means we can rename the io.write and string.char functions to p and c. On the same line, we also create an empty table.
p, c, l = io.write, string.char, {}
Next we need to populate our l table with the ASCII codes of A through Z, making sure to skip ASCII code 76 that represents an L.
To insert an element into a Lua table, we could use table.insert, but that would be quite long. So we get the length of l using #l, add 1 to the length, and place the ASCII code into the new index.
for i=65,90 do
if i ~= 76 then
l[#l + 1] = i
end
end
Once that's done, we then start looping over the table to print the characters. For this explanation, I'll expand p and c to show the function names.
The first loop will print the upper-case letters. Then we add a new line. Then we start another loop to print out the lower-case letters, that is +32 to our l ASCII table.
for j=1,#l do
io.write(string.char(l[j]))
end
io.write"\n"
for k=1,#l do
io.write(string.char(l[k] + 32))
end
Pip, 6 5 bytes
-1 byte thanks to @DLosc
zRM'l
Yea I think that's about as short as it can get, unless someone has some genius strategy.
Turns out I'm not genius enough :P
Deadfish~, 27 bytes
iisiiiis{ic}ici{ic}icicicic
My first Deadfish~ answer, I don't know if it could be improved.
How does it work?
ii accumulator: 2
s accumulator: 4
iiii accumulator: 8
s accumulator: 64
{ic} accumatator: [65, 75] ('A' -> 'J')
ic accumulator: 76 ('K')
i accumulator: 77
{ic} accumulator: [78, 88] ('M' -> 'V')
icicicic accumulator: [89, 92] ('X' -> 'Z')
YASEPL, 26 bytes
algorithmic way of doing it
=a$97`1}3,108,2›`2+}2,123
YASEPL, 28 bytes
lazy way of doing it
>"abcdefghijkmnopqrstuvwxyz"
morsecco: 112 bytes
Yes, that's 4.5 times the size of the pure input, but don't forget that we have only three symbols, resulting in a factor ~5, compared to the full character set.
The whole christmas alphabet in morse code already takes 102 characters; with the overhead of conversion and printing it would be 124 bytes, so this loop solution is shorter (not counting the christmas tree formatting, which starts beautifully with Entering 65, but doesn't really work out well, because whitespaces are sometimes meaningful in Morsecco):
.
-.....-
-- -
- -
-.- -
. -
.--
. .-..-.--
.-
--.. --.-
. .----
.- --.. --.
. -.--.--
.- --. --.-
. -..--.- --.
- The first line initializes the stack with 65 (
A) - Line 2 sets a jump
Mark to start a loop,Konvert the number toText andWrite it to stdout. - Now comes the golfing trick: line 3
Adds –75 (K) and skips after--.-is zero (so the last line handles theLskipping byEntering 77) - The 4th line subtracts another 15 to test for the
Zand skips after the--.that closes the loop for the other characters - The 5th line
Adds 91 (–75 + –15 + 91 = 1, so the value is incremented) andGoes to the mark that was set. This saves three bytes compared to saving a copy of the value, dropping the modified version and adding 1 to the copy.
Cheating version: 47 bytes
Yes, morsecco ignores all characters except for dot, dash and space, but to cheat, you can Read the source code from the empty address, Cut it after the Z and Output. Yes, such tricks are probably legal when golfing, but boring:
ABCDEFGHIJKMNOPQRSTUVWXYZ. .-. -.-. --..- ---
Python 3, 51 50 bytes
print(''.join(chr(i+65)for i in range(26)if i-11))
Simple iteration combining range and chr.
-1 byte thank to @UndoneStudios's amazing hint of using str.join
Python 3, 54 bytes
a=*range(65,91),
print(*map(chr,a[:11]+a[12:]),sep='')
Using tuple destructuring.
Python, 65 bytes:
Uses the formula given by Stef in the comments, so I guess this could probably stay up for not being boring...
lambda:''.join(chr(int(i+((1.5*i)**.5)//1))for i in range(56,81))
Knight (v2), 27 bytes
;=a 64W>91=a+1a|?76aO+Aa'\'
Well, at least it's shorter than this (28 bytes):
O"ABCDEFGHIJKMNOPQRSTUVWXYZ"
Pyth, 9 bytes
+<G11>G12
Explanation
G - Pyth's pre-initialised variable to the lowercase letters in the alphabet.
< - used to slice the string till 11.
> - used to slice the string from 12, thereby leaving the letter l.
Pyth, 4 bytes | Thanks to @FryAmTheEggman
-G"l
C (GCC), 48 46 42 bytes w/ help from @Neil and @ceilingcat
main(x){for(;x++<27;)x-13&&putchar(x+63);}
Kotlin, 40 35 bytes
{(('a'..'z')-'l').joinToString("")}
Kotlin, 40 35 31 bytes
{(('a'..'z')-'l').map(::print)}
Lambdas () -> String and () -> Unit, respectively, that uses minus applied to a CharRange.
-5 bytes thank to @corvus_192's wonderful reminder that minus can be replaced by -
-4 bytes on () -> Unit by replacing the forEach with a map.
Scala, 48 30 bytes
Saved 18 bytes thanks to @corvus_192
Golfed version. Try it online!
'A'to'Z'patch(11,"",1)mkString
Commodore BASIC - 28 characters
Enter this in direct mode, the ? denotes a PRINT command:
?"ABCDEFGHIJKMNOPQRSTUVWXYZ
Note that in Commodore BASIC, you do not necessarily require a closing quotation mark when printing a string literal.
Python, 39 bytes
print(25*"%c"%(*{*range(65,91)}-{76},))
Only 5 bytes longer than hardcoding the entire thing ...
How?
Unlike dictionaries, sets are in general not guaranteed to preserve insertion order, so why does this work?
C-Python implementation detail: (small) integers are their own hash values.
Python 3, 50 49 bytes
print(''.join(chr(x+x//76)for x in range(65,90)))
You could save two bytes by using Python 2, but nobody uses that anymore:
Python 2, 47 bytes
print ''.join(chr(x+x/76)for x in range(65,90))
jq, 27 characters
[range(65;91)]-[76]|implode
Sample run:
bash-5.2$ jq -nr '[range(65;91)]-[76]|implode'
ABCDEFGHIJKMNOPQRSTUVWXYZ
R, 22 bytes
!Map(cat,letters[-12])
Exits with an error; credit to ovs.
R, 23 bytes
x=Map(cat,letters[-12])
Also credit to ovs.
R, 24 bytes
cat(letters[-12],sep="")
Haskell, 23 bytes
filter(/='L')['A'..'Z']
Explanation
['A'..'Z'] represents the entire uppercase alphabet, (/='L') is a shorthand for the lambda \x -> x /= 'L'. When both are passed to filter, this keeps all letters from the alphabet that are not L.
Alternatively, this can also be done with an extra byte using list comprehensions:
[x|x<-['A'..'Z'],x/='L']
Acc!!, 41 bytes
Count i while 25-i {
Write (65+i)*77/76
}
Explanation
Loop i from 0 to 24. Add 65 to convert to uppercase codepoints A through Y; then scale by a linear factor to skip over code point 76 (L). (Division in Acc!! is integer division, but the floating-point version would be \$ 65.86, 66.87, \cdots, 74.97, 75.99, 77.00, 78.01, \cdots, 90.17 \$)
XPath 2: 42 41 27 bytes
First attempt: 42 bytes
codepoints-to-string(remove(97 to 122,12))
Explanation:
97 to 122returns the sequence 97, 98, 99, ... 122remove( ..., 12)removes the 12th itemcodepoints-to-string()converts the numbers to a string
The result of the evaluation is the christmas string. Try it online.
Second attempt 41 bytes, thanks to @Philippos
codepoints-to-string(remove(65 to 90,12))
(upper case letters)
Third attempt (27 bytes), the "trivial" (but so far the shortest) solution (@jonathan-allan)
"abcdefghijkmnopqrstuvwxyz"
is a equally valid XPath expression.
Bash, 23 bytes, original answer
printf %s {a..k} {m..z}
Bash, 21 bytes, thanks to Nahuel Fouilleul
echo {a..z}|tr -d \ l
CP-1610 machine code, 14 DECLEs1 = 17.5 bytes
1. CP-1610 instructions are encoded with 10-bit values (0x000 to 0x3FF), known as DECLEs. Although the Intellivision is also able to work on 16-bit data, programs were really stored in 10-bit ROM back then.
A routine that writes the Christmas alphabet at R4.
The method used here would be more relevant if there were several letters to skip. With just one letter, using SLLC / ADCR only saves a few CPU cycles compared to CMPI / BEQ.
ROMW 10 ; use 10-bit ROM
ORG $4800 ; map our code at $4800
4800 02BC 0200 MVII #$200, R4 ; R4 = BACKTAB pointer
4802 0004 0148 000D CALL alpha ; invoke our routine
4805 02BD 0030 MVII #$30, R5 ; R5 = pointer into STIC registers
4807 01C0 CLRR R0
4808 0268 MVO@ R0, R5 ; no horizontal delay
4809 0268 MVO@ R0, R5 ; no vertical delay
480A 0268 MVO@ R0, R5 ; no border extension
480B 0002 EIS ; enable interrupts
480C 0017 DECR R7 ; loop forever
;; our routine
alpha PROC
480D 02B8 010F MVII #$010F, R0 ; R0 = letter code, initialized to 'A'
480F 02B9 0010 MVII #$0010, R1 ; R1 = mask used to skip 'L'
4811 0059 @loop SLLC R1 ; left-shift the mask into the carry
4812 002F ADCR R7 ; add the carry to the program counter
; (i.e. skip MVO@ if the carry is set)
4813 0260 MVO@ R0, R4 ; write the letter
4814 02F8 0008 ADDI #8, R0 ; update R0 to the next letter
4816 0378 01D7 CMPI #$01D7, R0 ; compare with 'Z'
4818 0226 0008 BLE @loop ; loop if less than or equal
481A 00AF MOVR R5, R7 ; return
ENDP
Output
Octave / MATLAB, 21 18 bytes
Anonymous function that takes no inputs and outputs the string with uppercase letters.
@()['A':'K' 77:90]
How it works
The code concatenates the two ranges of letters: before and after the 'L'. The second range is defined numerically to save two bytes. This can be done because concatenating chars and numbers implicitly converts each number to the char with the corresponding codepoint.
x86-64 machine code, 17 15 bytes
B0 E6 04 5B AA 2C 4B 3C 01 14 F1 75 F5 AA C3
Following the standard calling convention for Unix-like systems (from the System V AMD64 ABI), this takes in RDI a memory address at which to place the result, as a null-terminated byte string.
In assembly:
f: mov al, -26 # Set AL to -26.
r: add al, 'Z'+1 # Add this value to AL to produce a letter.
stosb # Write AL to the output string, advancing the pointer.
sub al, 'K' # Subtract 'K' from AL.
cmp al, 1 # Set flags from calculating AL - 1. CF is 1 iff AL is 0.
adc al, 'K'-'Z' # Add (this value + CF) to AL. The net change is +1 or +2.
jnz r # If the result is nonzero, repeat the loop.
stosb # Write AL (0) to the output string, advancing the pointer.
ret # Return.
Retina, 14 bytes
26*#
Y`#`l
l
Try it online! Outputs in lowercase but if the program is uppercased then it will output in uppercase instead. Explanation:
26*#
Insert 26 #s. (I can't use the default _ because that's a special transliteration character.)
Y`#`l
Translate each # in turn into the next character of the alphabet. (It's possible to skip the l here but it's longer overall.)
l
Remove the l.
The best I could do in Retina 0.8.2 without resorting to 26-byte hard-coding was 27 bytes, but with some inspiration from @FryAmTheEggman I got it down to 16 15 bytes:
T`l`_l
}`$
z
l
Try it online! Outputs in lowercase but if the program is uppercased then it will output in uppercase instead. Explanation:
T`l`_l
Move all of the letters so far one step backwards in the alphabet, but delete any a.
$
z
Append a z to the current string.
}`
Repeat the above until the transformation becomes idempotent. This happens when the string is the entire alphabet; the a is deleted, the b-z get transliterated into a-y, and another z is appended.
l
Remove the l.
Python 3, 71 bytes
import string as s
print(s.ascii_lowercase[:11]+s.ascii_lowercase[12:])
Charcoal, 3 bytes
⁻βl
Try it online! Link is to verbose version of code. Explanation: β is a Charcoal variable predefined to the lowercase alphabet.
⁻αL
Try it online! Link is to verbose version of code. Explanation: α is a Charcoal variable predefined to the uppercase alphabet.
PowerShell Core, 25 bytes
-join$('a'..'k';'m'..'z')
I think solving that with 25 bytes has a certain je ne sais quoi.
Only works in PowerShell Core, Windows PowerShell can't enumerate characters.
PowerShell, all flavors, 27 bytes
'abcdefghijkmnopqrstuvwxyz'
The boring/trivial solution with 27, which would end up as National Fruitcake Day. Somewhat related to CodeGolf, as golfed code and fruitcake have a similar density.
PowerShell, all flavors, 31 bytes
-join([char[]]$(65..75;77..90))
So here's New Year's Eve.
Which is what we also get from the trivial solution in Batch:
Windows Batch, 31 bytes
@echo abcdefghijkmnopqrstuvwxyz
brainfuck, 49 bytes
+++++++++++++[->+>+++++>+<<<]>--[->.+<]>>+[-<+.>]
Starting with a cell containing 13 we set up 3 cells containing 13,65,13. The 65 is the ASCII code of the letter to be printed and the other cells are down-counters (which are adjusted to 11 and 14 before use.) A nice feature is that the loop for printing the first 11 letters increments the ASCII code after printing and the loop printing the last 14 letters increments the ASCII code before printing, thereby skipping L naturally.
Ruby, 19 bytes
([*?a..?z]-[?l])*''
Since the task allows simply returning the string instead of printing, I believe it should be acceptable as this snippet. If not, it's +4 for $><< in front.
Vyxal 3,, 4 bytes
n'l-
First Vyxal answer, so I’m sure there may be a more concise way, but I like that it almost reads ‘no el’!
Various Languages, 25 bytes
abcdefghijkmnopqrstuvwxyz
or
ABCDEFGHIJKMNOPQRSTUVWXYZ
In many languages, the shortest solution is also the least interesting.
Uiua, 11 bytes
▽≠@l.+@a⇡26
▽≠@l.+@a⇡26
⇡26 # range from 0 to 25
+@a # add letter a
. # duplicate
≠@l # where is it not equal to l?
▽ # keep
