You have to output the alphabet (upper case) with the shortest code possible.
Exact output expected : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It only takes a minute to sign up.
Sign up to join this community⎕A
It's a constant string with the uppercase letters from A to Z
BASH 21 chars
echo {A..Z}|tr -d " "
Output:
~$ echo {A..Z}|tr -d " "
ABCDEFGHIJKLMNOPQRSTUVWXYZ
bash
solution posted for this question's duplicate.
\$\endgroup\$
Feb 5, 2014 at 12:35
printf %s {A..Z}
gives me uppercase letters without any space.
\$\endgroup\$
Feb 5, 2014 at 12:41
cat(LETTERS,sep="")
Output:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Ruby 2.0.0, bytesize: 19:
=> p([*'A'..'Z'].join)
=> "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
update. this produce without quotes:
=> ruby -e '$><<[*?A..?Z].join'
=> ABCDEFGHIJKLMNOPQRSTUVWXYZ
?A
and ?Z
instead of 'A'
and 'Z'
. And you can use *''
instead of .join
. And the parenthesis is not necessary there. Sadly this outputs the alphabet between double quotes.
\$\endgroup\$
Feb 5, 2014 at 12:44
*''
!
\$\endgroup\$
var i:int16;begin for i:=65to 90do write(chr(i))end.
begin write('ABCDEFGHIJKLMNOPQRSTUVWXYZ');end.
program X;
is not necessary and in this case byte
is enough. Not mentioning that the variable declaration in the second version is pointless.
\$\endgroup\$
Feb 5, 2014 at 13:19