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 pgm tests if a word(s) can be created from a pool of toy blocks. */
<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 built.'
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: &nbsp; '''spelt''' &nbsp; is an alternate version of &nbsp; '''spelled'''.]
<pre>
<pre>
(null) can't be built.
(null) can't be spelt.
A can be built.
A can be spelt.
BARK can be built.
BARK can be spelt.
BOOK can't be built.
BOOK can't be spelt.
TREAT can be built.
TREAT can be spelt.
COMMON can't be built.
COMMON can't be spelt.
SQUAD can be built.
SQUAD can be spelt.
CONFUSE can be built.
CONFUSE can be spelt.
</pre>
</pre>