11
1
You are too make a program that take an integer as the input and outputs the first what ever that number was of the look and say sequence.
For example:
$ ./LAS
8
[1,11,21,1211,111221,312211,13112221,1113213211]
The exact way you output the list is unimportant, as long as users can distinctly see the different numbers of the sequence. Here is the catch though. You can't use any sort of user-defined variable.
For example:
- No variables, including scoped variables.
- When you have functions, they can not have a name. (Exception, if your language requires a main function or similar to work, you may have that function.)
- When you have functions, they can not have named arguments.
Also, you may not use a library with specific capabilities relating to the look and say sequence, and you can not access the network, or provide your program with any files (although it can generate and use its own.) This is code golf, so shortest code in characters wins!
1What is "EXTREME POINT FREENESS"? – Justin – 2014-03-12T03:44:15.923
1
@Quincunx I had to look it up: http://stackoverflow.com/questions/944446/what-is-point-free-style-in-functional-programming
– Digital Trauma – 2014-03-12T05:37:51.960Can you explain this rule:
When you have functions, they can not have named arguments.
? – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ – 2014-03-12T07:35:12.223Same sequence, different code constraint – Peter Taylor – 2014-03-12T10:25:13.397
3@ n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ In several languages (like the J language or stack/based languages like forth or postscript), functions don't have argument; they apply to some external context (a stack or arguments coming from an external scope). – Thomas Baruchel – 2014-03-12T11:54:32.587