Write a program to print or return one of these strings verbatim:
abcdefghijkmnopqrstuvwxyz ABCDEFGHIJKMNOPQRSTUVWXYZ Notice that there is no L.
Write a program to print or return one of these strings verbatim:
abcdefghijkmnopqrstuvwxyz ABCDEFGHIJKMNOPQRSTUVWXYZ Notice that there is no L.
{(('a'..'z')-'l').joinToString("")} {(('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.
{(('a'..'z')-'l').joinToString("")} \$\endgroup\$ minus can be overloaded as -. Thank you so much! \$\endgroup\$ main(x){for(;x++<27;)x-13&&putchar(x+63);} x-27&&(x-12&&putchar(x+64))+main(x+1); seems to work. \$\endgroup\$ x-26&&putchar(x+64+(x>11))+main(x+1);? \$\endgroup\$ c;f(){for(c=64;++c<91;)c-76&&putchar(c);} is 41 bytes, but f(){puts("abcdefghijkmnopqrstuvwxyz");} is 39 \$\endgroup\$ 91,65>76-+ \$\endgroup\$ ;=a 64W>91=a+1a|?76aO+Aa'\' Well, at least it's shorter than this (28 bytes):
O"ABCDEFGHIJKMNOPQRSTUVWXYZ" 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)) 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') "l" can be 'l \$\endgroup\$ -.,26ch+64$"L" ,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.
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.
+<G11>G12 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.
-G"l -, which is overloaded in Pyth to work on strings in a manner similar to how it works on sets. \$\endgroup\$ for i in range(65,90):print(end=chr(i+(i>75))) Yet another boring loop in Python 3 :)
-|@\$u"L" 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 _=>Array.from({length:25},(_,x)=>(x+10+(x>10)).toString(36)).join`` 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 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 -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