- Notifications
You must be signed in to change notification settings - Fork168
eatnumber1/goal
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
g()('al')
is a challenge whereby you need to write in as many languages aspossible code which enables the codeg()('al')
to return the string "goal",the codeg()()('al')
to return the string "gooal", the codeg()()()('al')
return the string "goooal", etc.
g()('al')
is the creation ofacruikshank who originally posed it as afunctional programming challenge. Extensive stubbornnessand misinterpretation led to its current form.
- You are encouraged to break the rules, cleverly.
- When executed, the solution must print "goal" with sufficient o's todemonstrate the program's functionality.
- The code
g()('al')
must appear in the source. g()('al')
must not be a string literal.'al'
must be a string, or your language's equivalent thereof. You mayuse your language's standard method of creating a string (e.x. C shoulduse"
, ruby may use either"
or'
).g()('al')
must be a validrvalue if applicable in your language.g()('al')
may not print the string. If returning a string cannot be donein your language, you should submit rationale as to why this is impossiblefor a solution which prints a string to be accepted.- You must be able to insert an arbitrary number of
()
calls withoutmodification to your solution. Therefore solutions likethis are incorrect. g('al')
must return"gal"
.
If you see a complete solution that breaks any of these rules, file a bug!
If you have a solution that is close, but does not meet these rules, submit itanyway. A close and interesting solution is better than no solution.
The more exciting solutions are original, not applying techniques that havealready been discovered. The following broadly applicable techniques havealready been discovered:
Solved | Incomplete | |
---|---|---|
ActionScript | • | |
Befunge | • | |
Bel | • | |
Brainfuck | • | |
C | • | |
C# | • | |
C++ | • | |
Clojure | • | |
Coffeescript | • | |
Common Lisp | • | |
D | • | |
Dart | • | |
DYLD | • | |
Emacs Lisp | • | |
English | • | |
Finite State Transducer | • | |
Forth | • | |
GNU Octave | • | |
Go | • | |
Groovy | • | |
Haskell | • | |
Haxe | • | |
IO | • | |
Java | • | |
JavaScript | • | |
Julia | • | |
Kotlin | • | |
Lua | • | |
Mathematica | • | |
Nimrod | • | |
Nix | • | |
OCaml | • | |
Objective-J | • | |
PHP | • | |
PHP 7 | • | |
Perl | • | |
Python | • | |
R | • | |
Raku | • | |
Regexp | • | |
Ruby | • | |
Rust | • | |
Scala | • | |
Scheme | • | |
Sed | • | |
Bourne Shell | • | |
TCL | • | |
XP | • | |
ZSH | • |
Help out, add some more languages!
Lets playgolf! Submit a pull-request with a shorter solution for an alreadysolved language and you can get the title of shortest, as shown in thatlanguage'sREADME.
Note: I'm not done making READMEs for all the languages yet. Don't let that stopyou!
These are some of the editor's favorite submissions:
- Befungesolution byarcovion
- Csolution bytolmasky
- C++solution byderrickturk
- C#solution byscorpiona with anexplanation
- Finite State Transducersolution byzippy-white
- Dynamic Linkersolution byeatnumber1
- Haskellsolution bycapicue with anexplanation
- Javasolution bylawl with anexplanation
- Nimrodsolution bydom96
- Perlsolution byworr with anexplanation
- SH incompletesolution bycsandreasen
- ZSHsolution byo11c with anexplanation