fork download
  1. +++++++++++ number of digits to output
  2. > #1
  3. + initial number
  4. >>>> #5
  5. ++++++++++++++++++++++++++++++++++++++++++++ (comma)
  6. > #6
  7. ++++++++++++++++++++++++++++++++ (space)
  8. <<<<<< #0
  9. [
  10. > #1
  11. copy #1 to #7
  12. [>>>>>>+>+<<<<<<<-]>>>>>>>[<<<<<<<+>>>>>>>-]
  13.  
  14. <
  15. divide #7 by 10 (begins in #7)
  16. [
  17. >
  18. ++++++++++ set the divisor #8
  19. [
  20. subtract from the dividend and divisor
  21. -<-
  22. if dividend reaches zero break out
  23. copy dividend to #9
  24. [>>+>+<<<-]>>>[<<<+>>>-]
  25. set #10
  26. +
  27. if #9 clear #10
  28. <[>[-]<[-]]
  29. if #10 move remaining divisor to #11
  30. >[<<[>>>+<<<-]>>[-]]
  31. jump back to #8 (divisor possition)
  32. <<
  33. ]
  34. if #11 is empty (no remainder) increment the quotient #12
  35. >>> #11
  36. copy to #13
  37. [>>+>+<<<-]>>>[<<<+>>>-]
  38. set #14
  39. +
  40. if #13 clear #14
  41. <[>[-]<[-]]
  42. if #14 increment quotient
  43. >[<<+>>[-]]
  44. <<<<<<< #7
  45. ]
  46.  
  47. quotient is in #12 and remainder is in #11
  48. >>>>> #12
  49. if #12 output value plus offset to ascii 0
  50. [++++++++++++++++++++++++++++++++++++++++++++++++.[-]]
  51. subtract #11 from 10
  52. ++++++++++ #12 is now 10
  53. < #11
  54. [->-<]
  55. > #12
  56. output #12 even if it's zero
  57. ++++++++++++++++++++++++++++++++++++++++++++++++.[-]
  58. <<<<<<<<<<< #1
  59.  
  60. check for final number
  61. copy #0 to #3
  62. <[>>>+>+<<<<-]>>>>[<<<<+>>>>-]
  63. <- #3
  64. if #3 output (comma) and (space)
  65. [>>.>.<<<[-]]
  66. << #1
  67.  
  68. [>>+>+<<<-]>>>[<<<+>>>-]<<[<+>-]>[<+>-]<<<-
  69. ]
  70.  
Success #stdin #stdout 0.02s 1704KB
stdin
Standard input is empty
stdout
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89