3 ms·
Code Golf - Perl, PHP, Python, Ruby
- globalrev 18y agoI don't get it, shortest how? When converted to machinelanguage? Here is my code in Erlang, using factorial(which is not recommended by the site): nCk(N, K) -> fac(N) / (fac(K) * fac(N - K)). what´s wrong with that?
- globalrev 18y agoah it means how many keystrokes it expands into?
- AndyKelley 18y agoIt's just going by character count.
- stcredzero 18y agoAPL would win, hands down, especially if you allowed specialized APL machines with all of the symbols available from the keyboard. APL was the original language for entire systems implemented in two lines of code that you had no hope of understanding after you wrote it.
- technoguyrob 18y agoAlso see Project Euler: http://projecteuler.net/ http://projecteuler.net/
- Oompa 18y agoSome of these problems are straight from Project Euler, but there's much more competition I feel with these. It's not just getting it done.
- deleted 18y ago[deleted]
- Tichy 18y agoWhat, no Java?
- xirium 18y agoThe constraint to be optimised is code size, not readability or speed. A strongly-typed language would be at a disadvantage if casting between datatypes was required.
- rcoder 18y agoIn Java, at least, you'll probably have exceeded the total character count of the 10th-place entry by the time you've opened stdin and parsed the first line of input. Even the single-character type sigils in Perl tend to make solutions longer than the Ruby or Python equivalents, much less full StudlyCaps signatures.
- gojomo 18y agoI still might stand a chance if I was allowed to type raw JVM bytecodes. :)
- xlnt 18y agoCan you beat any of the other languages with Java?
- Tichy 18y agoOf course not - I was only joking ;-)
- xirium 18y agoFrom the article: Based on the original perl golf, Code Golf allows you to show off your code-fu by trying to solve coding problems using the least number of keystrokes. I'll be a pedant and note that Code Golf is based on Perl Golf, which is based on the obfuscated Perl contests, which are based on the IOCCC. The major differences are implementation language, specified problem and a hard limit on submission size.
- jamongkad 18y agoI hope they include JavaScript...
- stcredzero 18y agoIt goes by keystrokes? APL would win! http://en.wikipedia.org/wiki/APL_ http://en.wikipedia.org/wiki/APL_(programming_language)