# The Symbols vs. The Letters

The ASCII characters have been divided once again! Your sets are The Letters and The Symbols.

## The Letters

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz


!"#$%&'()*+,-./0123456789:;<=>?@[\]^_{|}~  The task is to write two programs: 1. Print each of The Letters exactly once without using any of them in your program. 2. Print each of The Symbols exactly once without using any of them in your program. # Rules • Whitespace may appear in your program or the output. • Non-ASCII characters are not allowed. • Output goes to standard out or to a file as either the contents or name of the file. • No input. • Output must only contain ASCII characters from one set or the other. • The programs can be written in different languages or the same language with one exception: • The Whitespace language may only be used for one of the programs. • Standard loopholes apply. # Scoring # of characters in program 1 +# of characters in program 2 = Score Lowest score wins! ## Note: To encourage more submissions, you may still post an answer with a solution for only one of the programs. You won't be able to win, but you would still be able to show off something cool. Thanks to Calvin's Hobbies for inspiring the idea with his previous question. • This isn't possible in most languages... For example in Haskell = is inescapable – proud haskeller Aug 22 '14 at 16:10 • @proudhaskeller part of the challenge is picking a language where it is possible. – hmatt1 Aug 22 '14 at 16:54 • (I realise I should've thought of this while the question was in the sandbox, but) given the "whitespace may appear in the output" rule, does this mean the order of the (letters|symbols) doesn't matter? – FireFly Aug 22 '14 at 17:04 • @FireFly any order is fine. – hmatt1 Aug 22 '14 at 17:08 • Is it allowed to have control characters (codepoints 0 to 31 and 127) in your program? – FUZxxl Aug 22 '14 at 20:13 ## 10 Answers # Total: 53 characters # Total in a single language: 230 characters, Pyth # Part 1: Golfscript, 15 91,65>123,97>++  Outputs: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz  Explanation: 91, Make the list, [0 1 .. 90] 65> Take elements after the 65th, [65 66 .. 90] 123,97> Same, but [97 98 .. 122] + Add the list above to the newline character that is automatically pushed to the stack. List + str coerces to string by ascii encoding. + Same, for the other list.  # Part 2: Pyth, 38 JhCeGLjkmCdbsrCdCPhGsrhCPeGChGsrJhhhhJ  Outputs:  !"#$%&'()*+,-./0123456789:;<=>?@
[\]^_
{|}~


Explanation:

G = "abcdefghijklmnopqrstuvwxyz"   Implicit.
k = ""                             Implicit.
d = " "                            Implicit.
JhCeG                              J = 1 + chr(end(G))          # J = 123
L                                  def d(b): return
jk                                                k.join(
m                                                      map(lambda d:
Cd                                                                 chr(d),
b                                                                  b))
s                                  print(s(                    #print is implicit.
rCd                               range(chr(d),                 # chr(d) = 32
CPhG                                    chr(upper(head(G))))    # chr("A") = 65
srJhhhhJ                           print(s(range(J, 1+1+1+1+J)))


# Part 1: Pyth, 192

%*$"%\143"$52(65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122


Explanation:

$"%\143"$ => "%c". $ switches to and from Python parsing style, and in Python string parsing, \143 is the octal escape sequence for c. This answer is thus equivalent to the following Python-style code: ("%c" * 52) % (65, 66, 67, ...)  Of course, this doesn't work in Python, because printing in Python uses print, but printing in Pyth is implicit, so it works. Pyth solutions do not use any of the features added since the question was asked. • Where do I learn Pyth? From the examples? – Soham Chowdhury Sep 13 '14 at 5:46 • @SohamChowdhury The examples are a good place to start. Reading the docs is probably the next step - doc.txt in the primary directory. The final step is to start playing with it yourself, using the -d (debug) flag. The software is very new and so nothing better exists. As far as I know, only 3 people have ever used it, and I'm the only one to have used it regularly. Good luck, enjoy. – isaacg Sep 13 '14 at 6:12 # Python (Symbols, 87 82) from string import punctuation from string import digits print digits print punctuation  I just love Python's string module... Edit: from string import punctuation as p from string import digits as d print d print p  Output: 0123456789 !"#$%&'()*+,-./:;<=>?@[\]^_{|}~


# FALSE (Letters, 21)DUP (Letters, 20):

FALSE solution:

65[$91\>][$,$32+,1+]#  DUP sollution (1 char shorter) 65[$91<][$,$32+,1+]#


Output (for both):

AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz


Interpreter for FALSE.

## Total: 102

• wow nice! I've seen people say this couldn't be done in python, well done. – hmatt1 Aug 22 '14 at 20:13
• from string import* works equally well and cuts down the byte count. – aglasser Aug 22 '14 at 20:41
• @aglasser ... but using * is forbidden in this context... – ɐɔıʇǝɥʇuʎs Aug 22 '14 at 20:43
• You're right, can't believe I forgot * was a symbol haha. That explains why you didn't do from string import punctuation, digits either. Nice solution that follows the rules. Sorry about my mistake! – aglasser Aug 22 '14 at 20:45

## GolfScript (14 chars) + Deadfish x (116 chars) = 130 chars

91,65>{.32+}%+


and

xxcxxcdddKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKxKDxxxccxxxxxxxxxxKxKxKxKxKxKDxxxcxxcxxKxKxKxK

• +1 for being the first of four posts so far actually answer both parts. – Geobits Aug 22 '14 at 18:51

# Parts 1 and 2 in Ruby 2, 56 + 484 = 540

Part 1:

$><<_*''  ### Explanation • A Range containing a-z (?@...?[) and a Range containing A-Z (?...?{) become the elements of the array _ using the splat operator (*). • The 0th element ("@") and 27th element ("") of the array _ are set to nil. • The array _ is joined together using Array#* and printed to stdout ($>)
• You can replace *\$_ on the second line with p (or []). – Jordan Jan 23 '18 at 16:19