Quantcast
Channel: Print the Christmas alphabet - Code Golf Stack Exchange
Browsing all 46 articles
Browse latest View live

Answer by Albert.Lang for Print the Christmas alphabet

Python, 39 bytesprint(25*"%c"%(*{*range(65,91)}-{76},))Attempt This Online!Only 5 bytes longer than hardcoding the entire thing ...

View Article



Answer by princesanjivy for Print the Christmas alphabet

Pyth, 9 bytes+<G11>G12Try it online!ExplanationG - Pyth's pre-initialised variable to the lowercase letters in the alphabet.< - used to slice the string till 11.> - used to slice the string...

View Article

Answer by manatwork for Print the Christmas alphabet

jq, 27 characters[range(65;91)]-[76]|implodeSample run:bash-5.2$ jq -nr '[range(65;91)]-[76]|implode'ABCDEFGHIJKMNOPQRSTUVWXYZTry it online!

View Article

Answer by Mark Ransom for Print the Christmas alphabet

Python 3, 50 49 bytesprint(''.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 bytesprint ''.join(chr(x+x/76)for x in...

View Article

Answer by Emily for Print the Christmas alphabet

Haskell, 23 bytesfilter(/='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...

View Article


Answer by enzo for Print the Christmas alphabet

Kotlin, 40 bytes{('a'..'z').minus('l').joinToString("")}Try it online!Kotlin, 40 bytes{('a'..'z').minus('l').forEach(::print)}Try it online!Lambdas () -> String and () -> Unit, respectively, that...

View Article

Answer by enzo for Print the Christmas alphabet

Python 3, 51 bytesprint(*[chr(i+65)for i in range(26)if i-11],sep='')Try it online!Simple iteration combining range and chr.Python 3, 54 bytesa=*range(65,91),print(*map(chr,a[:11]+a[12:]),sep='')Try it...

View Article

Answer by Qaziquza for Print the Christmas alphabet

C (GCC), 48 46 bytes w/ help from @Neilmain(x){x-26&&putchar(x+64+(x>11))+main(x+1);}Attempt This Online!

View Article


Answer by DLosc for Print the Christmas alphabet

Acc!!, 41 bytesCount i while 25-i {Write (65+i)*77/76}Try it online!ExplanationLoop i from 0 to 24. Add 65 to convert to uppercase codepoints A through Y; then scale by a linear factor to skip over...

View Article


Answer by topskip for Print the Christmas alphabet

XPath 2: 4241 27 bytesFirst attempt: 42 bytescodepoints-to-string(remove(97 to 122,12))Explanation:97 to 122 returns the sequence 97, 98, 99, ... 122remove( ..., 12) removes the 12th...

View Article

Answer by 138 Aspen for Print the Christmas alphabet

Scala, 48 bytesGolfed version. Try it online!println(('a'to'z').patch(11,Nil,1).mkString(""))

View Article

Answer by Philippos for Print the Christmas alphabet

morsecco: 112 bytesYes, 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...

View Article

Image may be NSFW.
Clik here to view.

Answer by Arnauld for Print the Christmas alphabet

CP-1610 machine code, 14 DECLEs1 = 17.5 bytes1. 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,...

View Article


Answer by Nahuel Fouilleul for Print the Christmas alphabet

Perl 5, 13 bytessay A..K,M..ZTry it online!

View Article

Answer by m90 for Print the Christmas alphabet

x86-64 machine code, 17 15 bytesB0 E6 04 5B AA 2C 4B 3C 01 14 F1 75 F5 AA C3Try it online!Following the standard calling convention for Unix-like systems (from the System V AMD64 ABI), this takes in...

View Article


Answer by benlodz for Print the Christmas alphabet

Python 3, 71 bytesimport string as sprint(s.ascii_lowercase[:11]+s.ascii_lowercase[12:])Try it online!

View Article

Answer by Mama Fun Roll for Print the Christmas alphabet

sclin, 9 bytes$abc"l"--Try it on scline!Very straightforward.

View Article


Answer by tsh for Print the Christmas alphabet

V (vim), 14 bytes:h<_jjYZZPtmxTry it online!Yet another post uses the trick found by Lynn.

View Article

Answer by Neil for Print the Christmas alphabet

Retina, 14 bytes26*#Y`#`llTry 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...

View Article

Answer by Luis Mendo for Print the Christmas alphabet

Octave / MATLAB, 21 18 bytesAnonymous function that takes no inputs and outputs the string with uppercase letters.@()['A':'K' 77:90]Try it online!How it worksThe code concatenates the two ranges of...

View Article
Browsing all 46 articles
Browse latest View live




Latest Images