fork(4) download
  1. * make seed from stdin *
  2. ,+[-
  3. * make 7bit bitstring
  4. [[->[-->+>>>+<<]>>[-<<]<<+<]+>>]
  5. <<[-<<]
  6. >>>>>>>>>>>>>>>>,+]
  7. * current memory state: (s_)*s_s_s*
  8. * create a counter ( some initial random numbers should be discarded )
  9. >++++++++++[->++++++++++<]
  10. * M sequence generation loop
  11. * r(n)=r(n minus 3)xor r(n minus 28)
  12. * memory layout:
  13. * (r_)*r_r_r__C
  14. >[
  15. * slide and decrement the counter
  16. -[->>+<<]
  17. * move to the oldest random number ( 28 terms before )
  18. * ( making 2 markers to return )
  19. -<<<<<<++++[-<<++++++>>]-<<[-[-<<+>>]<<]
  20. * slide that to the next cell
  21. <[->+<]
  22. * move r(n minus 28) towards the top
  23. >>>+[-<<[->>+<<]>>>>+]
  24. * add r(n minus 3)
  25. <[-<+>>+<]>[-<+>]
  26. * move again
  27. +[-<<[->>+<<]>>>>+]
  28. * fix the bit ( change 2 to 0 )
  29. <<[-[->-<]>+<]
  30. * watch the counter
  31. * if over 4: do nothing
  32. * if 1 thru 4: only print "zun" or "doko"
  33. * if 0: print "zun" or "doko" and judge wheter to extend the counter
  34. >>+>+>>+<
  35. * memory layout:
  36. * (r_)*r_rpjCt
  37. * p: print flag
  38. * j: judge flag ( extension of the counter )
  39. * t: temporary
  40. [-[-[-[-[++++<<->->>-
  41. ]>[-< ++++< ->>>]<
  42. ]>[-< +++ < ->>>]<
  43. ]>[-< ++ < ->>>]<
  44. ]>[-< + < ->>>]<
  45. ]>[- >]
  46. * print "zun" ( if the last random number is 0 ) or "doko" ( else )
  47. <<<<[
  48. ++++++[->>>>+++++>--------->-------->->--[---------<]<<<]+
  49. <[>->>> ->-.>+.>.<<.>-.>>>.+[,+<+] ]
  50. >[->>>-> -.>.>>.<<<.>+.>>>.+[,+<+]> ]
  51. <<<<]
  52. * judge wheter to extend the counter
  53. * calculate the sum of r(n minus 4) thru r(n minus 1) and ( 1 minus r(n) )
  54. * extend the counter except the sum is 0
  55. >[-
  56. >-<<<<<<<<+[-<<<[-<+>>+<]<[->+<]>>[->>+<<]>>>>+]<
  57. <+<[-<+>>-<]<[->+<]>>[[-]>>+<<]>
  58. ]
  59. >]
  60. * print "kiyoshi!"
  61. +++++++[->>+++++++>------->->+>+++++<[-----------<]<]
  62. >>-.>.>+.<<.>+.>>+.<<<.>.>-----.<<.>.>>.<<<.>-.>>----.>--.
Success #stdin #stdout 0s 1912KB
stdin
4649
stdout
ズンドコドコドコドコドコズンドコズンドコズンズンズンズンズンズンドコキ・ヨ・シ!