Read in two digit number: 0 1 2 3 4 N0 N N0cp 10 N1 ,------------------------------------------------[>+>+<<-]>>[<<+>>-]>>,+[-<<<[-]>>>------------------------------------------------<++++++++++ [<<<[->+>+<<]>>[-<<+>>]>-] >[-<<<+>>>] ]<<<< # Now at 0 [-] (Clear N0) >[<+>-]< Layout now: N in 0 Place 'minus' in 1: >+++++++++++++++++++++++++++++++++++++++++++++< Place 'star' in 2: >>++++++++++++++++++++++++++++++++++++++++++<< Set line counter in 7: >>>>>>>+<<<<<<< Move N from 0 to 9 and 10: [>>>>>>>>>+>+<<<<<<<<<<-] Move N from 9 to 0 (leaving N in 10): >>>>>>>>>[<<<<<<<<<+>>>>>>>>>-]<<<<<<<<< Loop on (decreasing) N in 10: >>>>>>>>>>[<<<<<<<<<< Move decreasing N from 10 to 3 4 and 5: >>>>>>>>>>[<<<<<+<+<+>>>>>>>-]<<<<<<<<<< Move N from 5 to 10: >>>>>[>>>>>+<<<<<-]<<<<< Set 3 and 4 to decreasing N minus 1: >>>->-<<<< Print 'minus' (in 1) times in 3 (which is N minus 1) while zeroing 3: >>>[<<.>>-]<<< Move line counter from 7 to 8 and 9: >>>>>>>[>+>+<<-]<<<<<<< Add line counter from 9 onto 7 and 8: >>>>>>>>>[<+<+>>-]<<<<<<<<< Now 7 holds line counter and 8 holds 2*line counter Subtract 1 from 8 to let it hold 2*line counter minus 1: >>>>>>>>-<<<<<<<< Print 'star' (in 2) times in 8 (which is 2*line counter minus 1) while zeroing 8: >>>>>>>>[<<<<<<.>>>>>>-]<<<<<<<< Print 'minus' (in 1) times in 4 (which is N minus 1) while zeroing 4: >>>>[<<<.>>>-]<<<< Add 1 to line counter (in 7): >>>>>>>+<<<<<<< Subtract 1 from decreasing N in 10: >>>>>>>>>>-<<<<<<<<<< >>>++++++++++.[-]<<< Loop on (decreasing) N in 10 >>>>>>>>>>]<<<<<<<<<< Move N from 0 to 3 and 4: [>>>+>+<<<<-] Subtract 1 from 3 and 4 to let them contain N minus 1: >>>->-<<<< Print 'minus' (in 1) times in 3 (which is N minus 1) while zeroing 3: >>>[<<.>>-]<<< Print 'star' (in 2) one time: >>.<< Print 'minus' (in 1) times in 4 (which is N minus 1) while zeroing 4: >>>>[<<<.>>>-]<<<< ++++++++++.