Problem:
Code a Morris Sequence.
Requirements:
- Use as few characters as possible. A character is defined by anything that is not a newline, tab, or space.
- Any programming language, esoteric or traditional, may be used.
- The program should be free of buffer overflows and an exception may never be thrown.
- Your program must be able to print out an infinite number of iterations.
- Each iteration must be printed and be on its own line.
- Any and all compilation arguments may be used.
- If the Extra Credit below is not used, the sequence must begin with "1" as the starting number.
- Assume the input is always valid.
Extra Credit:
Allow the user to input his own number to start the sequence.
Examples:
Input:
Output:
Code:
1
11
21
1211
111221
{And so on}
Input:
Output:
Code:
3
13
1113
3113
132113
{And so on}
Input:
Output:
Code:
131313
111311131113
311331133113
13212321232113
{And so on}
Reference:
Stack Overflow
Bookmarks