Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/General-FizzBuzz/REXX/general-fizzbuzz-1.rexx
Normal file
16
Task/General-FizzBuzz/REXX/general-fizzbuzz-1.rexx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*REXX program shows a generalized FizzBuzz program: #1 name1 #2 name2 ··· */
|
||||
parse arg h $ /*obtain optional arguments from the CL*/
|
||||
if h='' | h="," then h= 20 /*Not specified? Then use the default.*/
|
||||
if $='' | $="," then $= "3 Fizz 5 Buzz 7 Baxx" /* " " " " " " */
|
||||
factors= words($) % 2 /*determine number of factors to use. */
|
||||
|
||||
do i=1 by 2 for factors /*parse the number factors to be used. */
|
||||
#.i=word($, i); @.i=word($, i+1) /*obtain the factor and its "name". */
|
||||
end /*i*/
|
||||
|
||||
do j=1 for h; z= /*traipse through the numbers to H. */
|
||||
do k=1 by 2 for factors /* " " " factors in J. */
|
||||
if j//#.k==0 then z= z || @.k /*Is it a factor? Then append it to Z.*/
|
||||
end /*k*/ /* [↑] Note: the factors may be zero.*/
|
||||
say word(z j, 1) /*display the number or its factors. */
|
||||
end /*j*/ /*stick a fork in it, we're all done. */
|
||||
11
Task/General-FizzBuzz/REXX/general-fizzbuzz-2.rexx
Normal file
11
Task/General-FizzBuzz/REXX/general-fizzbuzz-2.rexx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*REXX program shows a generalized FizzBuzz program: #1 name1 #2 name2 ··· */
|
||||
parse arg h $ /*obtain optional arguments from the CL*/
|
||||
if h='' | h="," then h= 20 /*Not specified? Then use the default.*/
|
||||
if $='' | $="," then $= "3 Fizz 5 Buzz 7 Baxx" /* " " " " " " */
|
||||
|
||||
do j=1 for h; z= /*traipse through the numbers to H. */
|
||||
do k=1 by 2 for words($)%2 /* " " " factors in J. */
|
||||
if j//word($,k)==0 then z= z || word($,k+1) /*Is it a factor? Then append it to Z.*/
|
||||
end /*k*/ /* [↑] Note: the factors may be zero.*/
|
||||
say word(Z j, 1) /*display the number or its factors. */
|
||||
end /*j*/ /*stick a fork in it, we're all done. */
|
||||
Loading…
Add table
Add a link
Reference in a new issue