Abbreviations, simple: Difference between revisions

Content added Content deleted
(→‎{{header|J}}: bugfix (had left out "half of the algorithm"))
Line 2,283: Line 2,283:
2 save set shift 2 si sort sos stack 3 status 4 top transfer 3 type 1 up 1
2 save set shift 2 si sort sos stack 3 status 4 top transfer 3 type 1 up 1
}} -.LF
}} -.LF

findmatch=: {{
findmatch=: {{
lens=. >{.ctable
lens=. >{.ctable
for_ndx. I.y-:"1&tolower (#y){.&> {:ctable do.
for_ndx. I.y-:"1&tolower (#y){.&> list do. cmd=. ;(<1,ndx){ctable
if. (#y) >: ndx{lens do. toupper;(<1,ndx){ctable return. end.
if. (#y) >: ndx{lens do. toupper cmd return. end.
if. y -: cmd do. toupper cmd return.end.
end.
end.
'*error*'
'*error*'
Line 2,294: Line 2,295:
Task:
Task:
<lang J> ;:inv findmatch cut ' riG rePEAT copies put mo rest types fup. 6 poweRin'
<lang J> ;:inv findmatch cut ' riG rePEAT copies put mo rest types fup. 6 poweRin'
RIGHT REPEAT *error* *error* MOVE RESTORE *error* *error* *error* POWERINPUT</lang>
RIGHT REPEAT *error* PUT MOVE RESTORE *error* *error* *error* POWERINPUT</lang>


=={{header|Java}}==
=={{header|Java}}==