RosettaCodeData/Task/ABC-problem/SenseTalk/abc-problem-1.sensetalk

42 lines
856 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
function CanMakeWord word
2026-02-01 16:33:20 -08:00
put [
("B", "O"),
("X", "K"),
("D", "Q"),
("C", "P"),
("N", "A"),
("G", "T"),
("R", "E"),
("T", "G"),
("Q", "D"),
("F", "S"),
("J", "W"),
("H", "U"),
("V", "I"),
("A", "N"),
("O", "B"),
("E", "R"),
("F", "S"),
("L", "Y"),
("P", "C"),
("Z", "M")
] into blocks
repeat with each character letter of word
put False into found
repeat with each item block of blocks by reference
if item 1 of block is letter ignoring case or item 2 of block is letter ignoring case
delete block
put True into found
exit repeat
end if
end repeat
if found is False
return False
end if
end repeat
return True
2023-07-01 11:58:00 -04:00
end CanMakeWord