Anonymous user
Enumerations: Difference between revisions
→{{header|REXX}}: changed/added comments and whitespace, changed indentations.
(→{{header|REXX}}: changed/added comments and whitespace, changed indentations.) |
|||
Line 1,050:
<br>This REXX entry was kinda modeled after the '''BASIC''', '''Forth''', and
'''VBA''' [which does its own enumeration, as does REXX below (as an inventory count)].
<lang rexx>/*REXX program
fruit.=0
fruit.apple
fruit.cherry
fruit.kiwi
fruit.peach
fruit.plum
fruit.raspberry
fruit.tomato
fruit.ugli
/* ┌──◄── A partial list of some fruits (below).
/*
/* ↓ */
FruitList= 'apple apricot avocado banana bilberry blackberry
'coconut cranberry cucumber
'jambul juneberry kiwi kumquat lemon lime lingenberry loquat lychee
'physalis pineapple pitaya pomegranate pomelo plum pumpkin rambutan raspberry
/*╔══════════════════════════════════════════════════════════════════════════════════════╗
╚══════════════════════════════════════════════════════════════════════════════════════╝*/
/* ┌─◄── due to a Central America blight in 1922; it was*/
/*
if fruit.banana=0 then say "Yes! We have no bananas today." /* (sic) */
if fruit.kiwi \=0 then say "We gots " fruit.kiwi
if fruit.peach\=0 then say "We gots " fruit.peach
maxL=length(' fruit ') /*ensure this header title can be shown*/
maxQ=length(' quantity ') /* " " " " " " " */
say
do
iterate /*j*/
end
/*stick a fork in it, we're all done. */</lang>
'''output'''
<pre>
Yes! We have no bananas today.
We gots 12 hairy fruit.
We gots 48 fuzzy fruit.
fruit quantity
|