-6
\$\begingroup\$

This question already has an answer here:

Goal

Your goal is to write "Code Golf" without using any letters [A-Z, a-z], even in your source code. It can't use of the following special characters either (!, _, <, (, ), ., {, }, ', and >).

Bonus / Scoring

  • If the code backwards also writes "Code Golf", you get -10.

Good luck! Standard loopholes disallowed. Mine also isn't a duplicate, because it also has character restrictions.

\$\endgroup\$

marked as duplicate by jimmy23013, ProgramFOX, GiantTree, Beta Decay, Geobits Jun 26 '15 at 12:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 10
    \$\begingroup\$ You wouldn't know this as a new user, but challenges of the form "Print X without using characters Y" have been poorly received in general. It seems like every new user comes in thinking it's a new and clever idea, which means they've been way overdone at this point. A lot of the answers use the same bag of tricks. Doing a simple task with limited tools often leads to less interesting solutions than a difficult task with a large array of tools. Try doing some challenges yourself to get a sense of what the community is into. \$\endgroup\$ – xnor Jun 26 '15 at 2:04
  • 4
    \$\begingroup\$ Also, having username-dependence is a bad idea. It means users whose names is shorter or longer or more compressible have an unfair advantage. It's not fun to be unable to use a method because your username doesn't allow it. \$\endgroup\$ – xnor Jun 26 '15 at 2:07
  • \$\begingroup\$ Ok - i'll fix it up a little more. \$\endgroup\$ – Admin3X Jun 26 '15 at 2:08
  • \$\begingroup\$ Maybe too restrictive?? \$\endgroup\$ – Erik the Outgolfer Sep 11 '16 at 10:10
2
\$\begingroup\$

CJam, 25

"¡ÍÂÃ~¥ÍÊÄ"94"`[]":^"-"+~

Try it online

Explanation:

"¡ÍÂÃ~¥ÍÊÄ" is "Code Golf" with each character (code point) incremented by 94.

"¡ÍÂÃ~¥ÍÊÄ"94    push that string and 94
"`[]":^          xor the characters '`', '[' and ']', obtaining 'f'
"-"+             concatenate with "-", resulting in "f-"
~                evaluate "f-", which subtracts 94 from each character
\$\endgroup\$
  • \$\begingroup\$ That's really clever. I had the string, but I couldn't figure out how to produce the f... \$\endgroup\$ – Dennis Jun 26 '15 at 13:26
  • \$\begingroup\$ @Dennis Thanks, I used another method first (you can see it in the edit history) \$\endgroup\$ – aditsu Jun 26 '15 at 13:28
5
\$\begingroup\$

HTML, 46 bytes

&#67;&#111;&#100;&#101; &#71;&#111;&#108;&#102;

This prints / outputs:

Code Golf

\$\endgroup\$
4
\$\begingroup\$

Whitespace, 146 characters

I have included Space, Tab, and Line feed indicators.

S S S T S S S S T   T   L
T   L
S S S S S T T   S T T   T   T   L
T   L
S S S S S S S T T   S S T   S S L
T   L
S S S S S S S T T   S S T   S T L
T   L
S S S S S S S S T   S S S S S L
T   L
S S S S S S S T S S S T T   T   L
T   L
S S S S S T T   S T T   T   T   L
T   L
S S S S S T T   S T T   S S L
T   L
S S S S S T T   S S T   T   S L
T   L
S S L
L
L

Try it online

Explanation:

  • S S pushes a number to the stack
  • S T S S S S T T L is the number 67 in binary ending with a line
  • T L S S outputs the top of the stack
  • This process repeats for each letter
  • Three linefeeds at the end terminates the program

Note that this does not end with a linefeed, so the command prompt will appear directly after the output. There is also some easy golfing by manipulating the stack and/or creating the numbers more efficiently, but it's past my bedtime...

Edit: I am unable to sleep and have been inspired by vihan1086's HTML answer. I don't see a requirement that the backwards-forwards running be in one language, so here is an WHITESPACE + LMTH answer that runs forwards and backwards:























;201#&;801#&;111#&;17#&;23#&;101#&;001#&;111#&;76#&

This scores 146 + 50 - 10 = 186

\$\endgroup\$
1
\$\begingroup\$

GolfScript, 27 bytes

0000000: 5b 31 32 33 20 31 32 36 20 31 32 35 5d 2b 7e  [123 126 125]+~
000000f: 22 bc 90 9b 9a df b8 90 93 99 22 25           "........."%

The above is a reversible xxd dump.

The only ASCII characters the code uses are [123 65]+~"%.

Proof of work

$ LANG=en_US
$ xxd -ps -r > codegolf.gs <<< 5b31323320313236203132355d2b7e22bc909b9adfb89093992225
$ wc -c codegolf.gs
27 codegolf.gs
$ golfscript codegolf.gs 
Code Golf

How it works

  • Lacking input, GolfScript initially has an empty string on the stack.

  • The array [123 126 125] contains the character codes of {, ~ and }.

  • + concatenates. Since strings take priority over arrays, this pushes "{~}".

  • ~ evaluates that string, pushing the block {~}.

  • The string of non-ASCII characters contains the logical NOTs of the character code of the string Code Golf.

  • % maps the pushed block over the string. ~ is logical NOT, which is involutive, so this pushes the character codes of Code Golf.

  • Finally, GolfScript prints the string on the stack.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.