AndyM to Concatenative Programming · 2 years agocode.golf now accepts Factor solutionscode.golfexternal-linkmessage-square1linkfedilinkarrow-up14arrow-down10file-text
arrow-up14arrow-down1external-linkcode.golf now accepts Factor solutionscode.golfAndyM to Concatenative Programming · 2 years agomessage-square1linkfedilinkfile-text
minus-squareAndyOPMlinkfedilinkarrow-up2·2 years 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 ] eachAnd for comparison: a Fizz Buzz walkthrough post from Factor dev John B.