Coder Social home page Coder Social logo

lastguest / goal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eatnumber1/goal

1.0 2.0 0.0 233 KB

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

PHP 3.14% Ruby 5.27% C++ 10.51% C# 5.28% C 30.93% Clojure 1.26% Common Lisp 2.46% D 5.96% Go 1.75% Groovy 0.74% Haskell 2.71% JavaScript 5.78% Julia 1.20% Lua 2.98% Nim 1.07% Objective-J 1.53% OCaml 1.12% Perl 1.26% Perl 6 5.78% Python 9.27%

goal's Introduction

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 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') 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.
  7. You must be able to insert an arbitrary number of () calls without modification to your solution. Therefore solutions like this are incorrect.
  8. g()('al') must be a valid rvalue if applicable in your language.
  9. g('al') must return "gal".
  10. 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:

Languages

Solved Incomplete Improbable
C
C#
C++
Clojure
Common Lisp
D
Go
Groovy
Haskell
Java
JavaScript
Julia
Lua
Nimrod
Objective-J
OCaml
Perl
Perl 6
PHP
Python
R
Ruby
Scala
Shell
ZSH

Help out, add some more languages!

Editor's Picks

These are some of the editor's favorite submissions:

Editor's Note

This got A LOT more popular than I expected. At the moment, there are 37 pull requests that I need to look at. Please be patient as it may take me a few days to get through them all. I'm prioritizing pull requests for new languages above ones for existing languages.

It would be super helpful if people wanted to help out by:

  1. Running other's submissions and confirming that they work correctly.
  2. Checking that the submissions aren't too similar to existing solutions.
  3. Checking that they follow all the rules.
  4. Calling out particularly clever solutions.

Just leave a comment on the pull request with your findings and I'll see it. Thanks!

goal's People

Contributors

capicue avatar cowlike avatar devongovett avatar dom96 avatar gambogi avatar hoffman avatar itafroma avatar jared-parsons avatar jcheng5 avatar jed avatar jeid64 avatar jhgg avatar krzysz00 avatar kylecronin avatar nickdepinet avatar orf avatar panzi avatar pda avatar peschwa avatar pguillory avatar raleksandar avatar robert-nix avatar seanmcgary avatar tolmasky avatar tomtheisen avatar truejournals avatar victornicollet avatar westleyargentum avatar xchrdw avatar zemnmez avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.