jeid64 / goal

g()()()()('al') -> "gooooal"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

g()('al')

g()('al') is a challenge whereby you need to write in as many languages as possible code which enables the code g()('al') to return the string "goal", the code g()()('al') to return the string "gooal", the code g()()()('al') return the string "goooal", etc.

Rules

  1. You are encouraged to break the rules, cleverly.
  2. When executed, the solution must print "goal" with sufficient o's to demonstrate the program's functionality.
  3. The program must not modify itself.
  4. The code g()('al') must appear in the source.
  5. g()('al') must not be a string
  6. 'al' must be a string, or your language's equivalent thereof. You may use your language's standard method of creating a string (e.x. C should use ", ruby may use either " or ').
  7. g()('al') may not print the string. If returning a string cannot be done in your language, you should submit rationale as to why this is impossible for a solution which prints a string to be accepted.
  8. You must be able to insert an infinite number of () calls without modification to your solution. Therefore solutions like this are incorrect.

Languages

Solved Likely Possible Likely Impossible Impossible
C partial
C++
Go
Haskell
Java
JavaScript
Perl
Python
Ruby
SH
BASH
ZSH

Help out, add some more languages!

About

g()()()()('al') -> "gooooal"


Languages

Language:C 71.4%Language:Python 9.4%Language:Haskell 8.7%Language:C++ 6.0%Language:JavaScript 3.2%Language:Ruby 1.5%