ABC problem: Difference between revisions

m
→‎{{header|REXX}}: added an archaic form of spelling. -- ~~~~
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:
 
=={{header|REXX}}==
<lang rexx>/*REXX pgmprogram tests if a word(s) can be createdspelt 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'
list = 'A baRk bOOk trEat coMMon squaD conFuse' /*can be in any case. */
Line 199:
 
if x=='' then x="(null)" /*express a NULL better.*/
say right(x,20) right(word("can't can",OK+1),6) 'be builtspelt.'
return OK /*also, return flag. */</lang>
'''output'''
<br>[Spelling note: &nbsp; '''spelt''' &nbsp; is an alternate version of &nbsp; '''spelled'''.]
<pre>
(null) can't be builtspelt.
A can be builtspelt.
BARK can be builtspelt.
BOOK can't be builtspelt.
TREAT can be builtspelt.
COMMON can't be builtspelt.
SQUAD can be builtspelt.
CONFUSE can be builtspelt.
</pre>