Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

goal

> 编程语言
Open source

g()()()()('al') → "gooooal"

346 stars0 likes0 views
WebsiteGitHub

About

g()()()()('al') → "gooooal"

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.

g()('al') is the creation of [acruikshank] who originally posed it as a [functional programming challenge][carbonfive-challenge]. Extensive stubbornness and misinterpretation led to its current form.

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 code g()('al') must appear in the source.
  4. g()('al') must not be a string literal.
  5. '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 ').
  6. g()('al') must be a valid [rvalue] if applicable in your language.
  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 arbitrary number of () calls without modification to your solution. Therefore solutions like this are incorrect.
  9. 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 it anyway. A close and interesting solution is better than no solution.

Previous Solutions

The more exciting solutions are original, not applying techniques that have already been discovered. The following broadly applicable techniques have already been discovered:

  • Self-modifying code
  • Aborting early
  • Human language

Languages

Solved Incomplete
ActionScript •
Befunge •
Bel •
Brainfuck •
C •
C# •
C++ •
Clojure •
Coffeescript •
Common Lisp •
D •
Dart •
[DYLD] •
Emacs Lisp •
English •
[Finite State Transducer][fst] •
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][xp-lang] •
ZSH •

Help out, add some more languages!

g()('lf')

Lets play [golf]! Submit a pull-request with a shorter solution for an already solved language and you can get the title of shortest, as shown in that language's [README][c-sharp-readme].

Note: I'm not done making READMEs for all the languages yet. Don't let that stop you!

Editor's Picks

These are some of the editor's favorite submissions:

  • Befunge solution by [arcovion]
  • C solution by [tolmasky]
  • C++ solution by [derrickturk]
  • C# solution by [scorpiona] with an [explanation][cs-explain]
  • Finite State Transducer solution by [zippy-white]
  • Dynamic Linker solution by [eatnumber1]
  • Haskell solution by [capicue] with an [explanation][hs-explain]
  • Java solution by [lawl] with an [explanation][java-explain]
  • Nimrod solution by [dom96]
  • Perl solution by [worr] with an [explanation][perl-explain]
  • SH incomplete solution by [csandreasen]
  • ZSH solution by [o11c] with an [explanation][zsh-explain]

//: # (Solu

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言