Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/FizzBuzz/REXX/fizzbuzz-1.rexx
Normal file
8
Task/FizzBuzz/REXX/fizzbuzz-1.rexx
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/*REXX program displays numbers 1 ──► 100 (some transformed) for the FizzBuzz problem.*/
|
||||
/*╔═══════════════════════════════════╗*/
|
||||
do j=1 to 100; z= j /*║ ║*/
|
||||
if j//3 ==0 then z= 'Fizz' /*║ The divisors (//) of the IFs ║*/
|
||||
if j//5 ==0 then z= 'Buzz' /*║ must be in ascending order. ║*/
|
||||
if j//(3*5)==0 then z= 'FizzBuzz' /*║ ║*/
|
||||
say right(z, 8) /*╚═══════════════════════════════════╝*/
|
||||
end /*j*/ /*stick a fork in it, we're all done. */
|
||||
10
Task/FizzBuzz/REXX/fizzbuzz-2.rexx
Normal file
10
Task/FizzBuzz/REXX/fizzbuzz-2.rexx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/*REXX program displays numbers 1 ──► 100 (some transformed) for the FizzBuzz problem.*/
|
||||
/*╔═══════════════════════════════════╗*/
|
||||
do j=1 to 100 /*║ ║*/
|
||||
select /*║ ║*/
|
||||
when j//15==0 then say 'FizzBuzz' /*║ The divisors (//) of the WHENs ║*/
|
||||
when j//5 ==0 then say ' Buzz' /*║ must be in descending order. ║*/
|
||||
when j//3 ==0 then say ' Fizz' /*║ ║*/
|
||||
otherwise say right(j, 8) /*╚═══════════════════════════════════╝*/
|
||||
end /*select*/
|
||||
end /*j*/ /*stick a fork in it, we're all done. */
|
||||
8
Task/FizzBuzz/REXX/fizzbuzz-3.rexx
Normal file
8
Task/FizzBuzz/REXX/fizzbuzz-3.rexx
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/*REXX program displays numbers 1 ──► 100 (some transformed) for the FizzBuzz problem.*/
|
||||
|
||||
do j=1 for 100; _=
|
||||
if j//3 ==0 then _=_'Fizz'
|
||||
if j//5 ==0 then _=_'Buzz'
|
||||
/* if j//7 ==0 then _=_'Jazz' */ /* ◄─── note that this is a comment. */
|
||||
say right(word(_ j,1),8)
|
||||
end /*j*/ /*stick a fork in it, we're all done. */
|
||||
6
Task/FizzBuzz/REXX/fizzbuzz-4.rexx
Normal file
6
Task/FizzBuzz/REXX/fizzbuzz-4.rexx
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/*REXX program displays numbers 1 ──► 100 (some transformed) for the FizzBuzz problem.*/
|
||||
/* [↓] concise, but somewhat obtuse. */
|
||||
do j=1 for 100
|
||||
say right(word(word('Fizz', 1+(j//3\==0))word('Buzz', 1+(j//5\==0)) j, 1), 8)
|
||||
end /*j*/
|
||||
/*stick a fork in it, we're all done. */
|
||||
Loading…
Add table
Add a link
Reference in a new issue