Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (72 sloc) 1.91 KB
Master counter = 100
>++++++++++[<++++++++++>-]
Set up alphabetical outputs
>>>>>>>>>>>>>>>>
++++[>++++<-]>
[<<<<<<<++>+++>++++>++++++>+++++++>+++++++>++++>-]
<++<+++++<++++++++++<+++++++++<++++++
<<<<<<<<<<<<<
[
Increment by3 and by5 remainder counters
and clear the "was divisible" flag
>+>+>[-]
If the by3 counter is 0 print Fizz
and increment the "was divisible" flag
>>>>[-]>[-]<<<<<<<
[>>>>>>+>+<<<<<<<-]
>>>>>>[<<<<<<+>>>>>>-]+
>---[<->[-]]
<[
>>>>>>.>.>..<<<<<<<<
<<<<+<<[-]>>>>>>-
]
If the by5 counter is 0 print Buzz
and increment the "was divisible" flag
<<<<<[>>>>>+>+<<<<<<-]
>>>>>[<<<<<+>>>>>-]+
>-----[<->[-]]
<[
>>>>>>>>>>.<.<..<<<<<<<<
<<<<+<[-]>>>>>-
]
Increment the low byte of the three byte representation
<+
If the low byte is 10 increment the second byte and zero the low
>[-]>[-]>[-]<<<
[>+>+>+<<<-]
>[<+>-]+
>----------[<->[-]]
<[
<<+>[-]>-
]
If the second byte is 10 increment the high byte and zero the second
>[-]>[-]<<<<
[>>+>+>+<<<<-]>>[<<+>>-]+
>----------[<->[-]]
<[
<<<+>[-]>>-
]
If the "was divisible" flag is 0 print the number
[-]>[-]
<<<<<[>>>>+>+<<<<<-]>>>>[<<<<+>>>>-]+
>[<->[-]]
<[
If the high byte is set print it out
Cheat slightly because of the following code section
[-]>[-]
<<<<
[>>>+>+<<<<-]>>>>[<<<<+>>>>-]
<[>++++++++[<++++++>-]<.-.[-]]
If the second byte is set print it out
This will fail to print the first 0 in "100" so that gets printed manually above
[-]>[-]
<<<
[>>+>+<<<-]>>>[<<<+>>>-]
<[>++++++++[<++++++>-]<.[-]]
Print the low byte regardless of value
[-]>[-]<<[>+>+<<-]>>[<<+>>-]++++++++[<++++++>-]<.[-]
]
Print a space and loop
>>>>.
<<<<<<<<<<<-
]
Something went wrong with that request. Please try again.