- Solve problem
- Lowest character count wins*
- Make it work
- Make is small
- Make it really small
- No smaller than than I can still read it
- File size in bytes is score.
- Hint: Use linux line endings and ASCII text files
- Adjudicator's decision on “solution good and in the spirit of the problem posed” is final.
Print the following rhyme to the console
Ten green bottles standing on the wall
Ten green bottles standing on the wall
And if one green bottle should accidentally fall,
There'll be nine green bottles standing on the wall.
Note: Care must be taken to match case, line endings and punctuation
Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
The output will be a list of numbers (and Fizzes, Buzzes and FizzBuzzes) separated by a newline (either \n or \r\n). A trailing newline is acceptable, but a leading newline is not. Apart from your choice of newline, the output should look like this:
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
...
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz
Take any integer number n.
- If n is even, divide it by 2 to get n/2
- If n is odd multiply it by 3 and add 1 to obtain 3n+1 Repeat the process forming a sequence of numbers until you reach 1.
So the sequence starting with 13 is:
13, 40, 20, 10, 5, 16, 8, 4, 2, 1
With a length of 10
See https://en.wikipedia.org/wiki/Collatz_conjecture for further information.
Read a number from the command line or user input and output the length of the Collatz sequence.