AndyM to Concatenative Programming · 1 year agocode.golf now accepts Factor solutionscode.golfexternal-linkmessage-square1fedilinkarrow-up14arrow-down10file-text
arrow-up14arrow-down1external-linkcode.golf now accepts Factor solutionscode.golfAndyM to Concatenative Programming · 1 year agomessage-square1fedilinkfile-text
minus-squareAndyOPMlinkfedilinkarrow-up2·1 year agoTo celebrate, here’s my crappy Fizz Buzz solution! USING: io kernel math.functions math.parser ranges sequences ; 100 [1..b] [ dup [ 3 divisor? ] [ 5 divisor? ] bi 2dup or [ [ drop ] 2dip [ "Fizz" "" ? ] [ "Buzz" "" ? ] bi* append ] [ 2drop number>string ] if print ] each And for comparison: a Fizz Buzz walkthrough post from Factor dev John B.
To celebrate, here’s my crappy Fizz Buzz solution!
USING: io kernel math.functions math.parser ranges sequences ; 100 [1..b] [ dup [ 3 divisor? ] [ 5 divisor? ] bi 2dup or [ [ drop ] 2dip [ "Fizz" "" ? ] [ "Buzz" "" ? ] bi* append ] [ 2drop number>string ] if print ] each
And for comparison: a Fizz Buzz walkthrough post from Factor dev John B.