* make seed from stdin *
,+[-
* make 7bit bitstring
[[->[-->+>>>+<<]>>[-<<]<<+<]+>>]
<<[-<<]
>>>>>>>>>>>>>>>>,+]
* current memory state: (s_)*s_s_s*
* create a counter ( some initial random numbers should be discarded )
>++++++++++[->++++++++++<]
* M sequence generation loop
* r(n)=r(n minus 3)xor r(n minus 28)
* memory layout:
* (r_)*r_r_r__C
>[
* slide and decrement the counter
-[->>+<<]
* move to the oldest random number ( 28 terms before )
* ( making 2 markers to return )
-<<<<<<++++[-<<++++++>>]-<<[-[-<<+>>]<<]
* slide that to the next cell
<[->+<]
* move r(n minus 28) towards the top
>>>+[-<<[->>+<<]>>>>+]
* add r(n minus 3)
<[-<+>>+<]>[-<+>]
* move again
+[-<<[->>+<<]>>>>+]
* fix the bit ( change 2 to 0 )
<<[-[->-<]>+<]
* watch the counter
* if over 4: do nothing
* if 1 thru 4: only print "zun" or "doko"
* if 0: print "zun" or "doko" and judge wheter to extend the counter
>>+>+>>+<
* memory layout:
* (r_)*r_rpjCt
* p: print flag
* j: judge flag ( extension of the counter )
* t: temporary
[-[-[-[-[++++<<->->>-
]>[-< ++++< ->>>]<
]>[-< +++ < ->>>]<
]>[-< ++ < ->>>]<
]>[-< + < ->>>]<
]>[- >]
* print "zun" ( if the last random number is 0 ) or "doko" ( else )
<<<<[
++++++[->>>>+++++>--------->-------->->--[---------<]<<<]+
<[>->>> ->-.>+.>.<<.>-.>>>.+[,+<+] ]
>[->>>-> -.>.>>.<<<.>+.>>>.+[,+<+]> ]
<<<<]
* judge wheter to extend the counter
* calculate the sum of r(n minus 4) thru r(n minus 1) and ( 1 minus r(n) )
* extend the counter except the sum is 0
>[-
>-<<<<<<<<+[-<<<[-<+>>+<]<[->+<]>>[->>+<<]>>>>+]<
<+<[-<+>>-<]<[->+<]>>[[-]>>+<<]>
]
>]
* print "kiyoshi!"
+++++++[->>+++++++>------->->+>+++++<[-----------<]<]
>>-.>.>+.<<.>+.>>+.<<<.>.>-----.<<.>.>>.<<<.>-.>>----.>--.