2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,8 +1,8 @@
|
|||
/*REXX program displays numbers 1 ──► 100 for the FizzBuzz problem. */
|
||||
|
||||
do j=1 to 100; z=j /*╔═════════════════════════════╗*/
|
||||
if j//3 ==0 then z='Fizz' /*║ The IFs must be in ║*/
|
||||
if j//5 ==0 then z='Buzz' /*║ ascending order.║*/
|
||||
if j//(3*5)==0 then z='FizzBuzz' /*╚═════════════════════════════╝*/
|
||||
say right(z,8)
|
||||
end /*j*/ /*stick a fork in it, we're done.*/
|
||||
/*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. */
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
/*REXX program displays numbers 1 ──► 100 for the FizzBuzz problem. */
|
||||
|
||||
do n=1 for 100
|
||||
select /*╔═════════════════════════════╗*/
|
||||
when n//15==0 then say 'FizzBuzz' /*║ The WHENs must be in ║*/
|
||||
when n//5 ==0 then say ' Buzz' /*║ descending order║*/
|
||||
when n//3 ==0 then say ' Fizz' /*╚═════════════════════════════╝*/
|
||||
otherwise say right(n,8)
|
||||
end /*select*/
|
||||
end /*n*/ /*stick a fork in it, we're done.*/
|
||||
/*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. */
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/*REXX program displays numbers 1 ──► 100 for the FizzBuzz problem. */
|
||||
/*REXX program displays numbers 1 ──► 100 (some transformed) for the FizzBuzz problem.*/
|
||||
|
||||
do n=1 for 100; _=
|
||||
if n//3 ==0 then _=_'Fizz'
|
||||
if n//5 ==0 then _=_'Buzz'
|
||||
/* if n//7 ==0 then _=_'Jazz' */ /*◄───note that this is a comment*/
|
||||
say right(word(_ n,1),8)
|
||||
end /*n*/ /*stick a fork in it, we're done.*/
|
||||
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. */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*REXX program displays numbers 1 ──► 100 for the FizzBuzz problem. */
|
||||
/* [↓] concise & somewhat obtuse*/
|
||||
do n=1 for 100
|
||||
say right(word(word('Fizz',1+(n//3\==0))word('Buzz',1+(n//5\==0)) n,1),8)
|
||||
end /*n*/
|
||||
/*stick a fork in it, we're done.*/
|
||||
/*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