capitalex zrewidował ten Gist 1 year ago. Przejdź do rewizji
1 file changed, 25 insertions
fizzbuzz.poqs(stworzono plik)
| @@ -0,0 +1,25 @@ | |||
| 1 | + | : {run fizzbuzz from $x to $y} > | |
| 2 | + | {current number is $x} {run fizzbuzz to $y} : | |
| 3 | + | ||
| 4 | + | : {run fizzbuzz to $n} {current number is $n} > | |
| 5 | + | {fizz $n} {buzz $n} {number is $n} : | |
| 6 | + | ||
| 7 | + | : {run fizzbuzz to $stop-value} {current number is $n} > | |
| 8 | + | {run fizzbuzz to $stop-value} | |
| 9 | + | {next number from $n} {fizz $n} {buzz $n} {number is $n} {wrote ""} : | |
| 10 | + | ||
| 11 | + | : {fizz $n} > {@modulo $n and #3 into &"mod 3 is *"} : | |
| 12 | + | : {buzz $n} > {@modulo $n and #5 into &"mod 5 is *"} : | |
| 13 | + | ||
| 14 | + | : {mod 3 is #0} {wrote $something} > {@write "fizz"} {wrote "fizz"} : | |
| 15 | + | : {mod 3 is $x} > : | |
| 16 | + | ||
| 17 | + | : {mod 5 is #0} {wrote $something} > {@write "buzz"} {wrote "buzz"} : | |
| 18 | + | : {mod 5 is $x} > : | |
| 19 | + | ||
| 20 | + | : {number is $number} {wrote ""} > {@write $number} {@write "\n"} : | |
| 21 | + | : {number is $number} {wrote $something} > {@write "\n"} : | |
| 22 | + | ||
| 23 | + | : {next number from $n} > {@add $n and #1 into &"current number is *"} : | |
| 24 | + | ||
| 25 | + | {run fizzbuzz from #1 to #100000} | |
Nowsze
Starsze