2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,17 +1,17 @@
/*REXX program displays a cuboid (dimensions must be positive integers). */
parse arg x y z indent . /*x,y,z: dimensions and indentation. */
x=p(x 2); y=p(y 3); z=p(z 4) /*use the defaults if not specified. */
in=p(indent 0)
call show y+2 , , "+-"
do j=1 for y; call show y-j+2, j-1, "/ |" ; end
call show , y , "+-|"
do z-1; call show , y , "| |" ; end
call show , y , "| +"
do j=1 for y; call show , y-j, "| /" ; end
call show , , "+-"
exit /*stick a fork in it, we're all done. */
/*────────────────────────────────────────────────────────────────────────────*/
p: return word(arg(1), 1) /*pick the first number or word in list*/
/*────────────────────────────────────────────────────────────────────────────*/
show: parse arg #,$,a 2 b 3 c 4 /*get the arguments (or parts thereof).*/
say left('',in)right(a,p(# 1))copies(b,4*x)a || right(c,p($ 0)+1); return
/*REXX program displays a cuboid (dimensions, if specified, must be positive integers).*/
parse arg x y z indent . /*x, y, z: dimensions and indentation.*/
x=p(x 2); y=p(y 3); z=p(z 4); in=p(indent 0) /*use the defaults if not specified. */
pad=left('', in) /*indentation must be non-negative. */
call show y+2 , , "+-"
do j=1 for y; call show y-j+2, j-1, "/ |" ; end /*j*/
call show , y , "+-|"
do z-1; call show , y , "| |" ; end /*z-1*/
call show , y , "| +"
do j=1 for y; call show , y-j, "| /" ; end /*j*/
call show , , "+-"
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
p: return word( arg(1), 1) /*pick the first number or word in list*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
show: parse arg #,$,a 2 b 3 c 4 /*get the arguments (or parts thereof).*/
say pad || right(a, p(# 1) )copies(b, 4*x)a || right(c, p($ 0) + 1); return