ABC problem: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: made the toy block letters to match the task's version of the blocks. -- ~~~~) |
m (→{{header|REXX}}: added an archaic form of spelling. -- ~~~~) |
||
Line 168: | Line 168: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
<lang rexx>/*REXX |
<lang rexx>/*REXX program tests if a word(s) can be spelt from a pool of toy blocks*/ |
||
blocks = 'BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM' |
blocks = 'BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM' |
||
list = 'A baRk bOOk trEat coMMon squaD conFuse' /*can be in any case. */ |
list = 'A baRk bOOk trEat coMMon squaD conFuse' /*can be in any case. */ |
||
Line 199: | Line 199: | ||
if x=='' then x="(null)" /*express a NULL better.*/ |
if x=='' then x="(null)" /*express a NULL better.*/ |
||
say right(x,20) right(word("can't can",OK+1),6) 'be |
say right(x,20) right(word("can't can",OK+1),6) 'be spelt.' |
||
return OK /*also, return flag. */</lang> |
return OK /*also, return flag. */</lang> |
||
'''output''' |
'''output''' |
||
<br>[Spelling note: '''spelt''' is an alternate version of '''spelled'''.] |
|||
<pre> |
<pre> |
||
(null) can't be |
(null) can't be spelt. |
||
A can be |
A can be spelt. |
||
BARK can be |
BARK can be spelt. |
||
BOOK can't be |
BOOK can't be spelt. |
||
TREAT can be |
TREAT can be spelt. |
||
COMMON can't be |
COMMON can't be spelt. |
||
SQUAD can be |
SQUAD can be spelt. |
||
CONFUSE can be |
CONFUSE can be spelt. |
||
</pre> |
</pre> |