Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
|
|
@ -7,15 +7,15 @@ blocks= 'BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY
|
|||
exit /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
spell: procedure expose blocks; arg x /*ARG uppercases the word to be spelt.*/
|
||||
L=length(x); @.=0 /*get length of the word to be spelt. */
|
||||
do try=1 for L; z=blocks; upper z /*use a fresh copy of the "Z" blocks.*/
|
||||
do n=1 for L; y=substr(x, n, 1) /*attempt another letter in the word. */
|
||||
@.n=pos(y, z, 1 + @.n); if @.n==0 then leave /*not found? Try again*/
|
||||
z=overlay(' ', z, @.n) /*mutate the toy block ───► a onesy. */
|
||||
do q=1 for words(z); if length(word(z, q))==1 then z=delword(z, q, 1)
|
||||
L= length(x); @.= 0 /*get length of the word to be spelt. */
|
||||
do try=1 for L; z= blocks; upper z /*use a fresh copy of the "Z" blocks.*/
|
||||
do n=1 for L; y= substr(x, n, 1) /*attempt another letter in the word. */
|
||||
@.n= pos(y, z, 1 + @.n); if @.n==0 then leave /*not found? Try again*/
|
||||
z= overlay(' ', z, @.n) /*mutate the toy block ───► a onesy. */
|
||||
do q=1 for words(z); if length(word(z,q))==1 then z= delword(z, q, 1)
|
||||
end /*q*/ /* [↑] elide any existing onesy block.*/
|
||||
if n==L then leave try /*was last letter used in the spelling?*/
|
||||
end /*n*/ /* [↑] end of a toy block usage. */
|
||||
end /*try*/ /* [↑] end of a "TRY" permute. */
|
||||
say right(arg(1), 30) right( word( "can't can", (n==L) +1), 6) 'be spelt.'
|
||||
say right( arg(1), 30) right( word( "can't can", (n==L) + 1), 6) 'be spelt.'
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue