Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
28
Task/ABC-problem/EMal/abc-problem.emal
Normal file
28
Task/ABC-problem/EMal/abc-problem.emal
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
List words ← text["", "A", "Bark", "book", "TREAT", "COMMON", "SQuAd", "CONFUSE"]
|
||||
List checks ← logic[true, true, true, false, true, false, true, true]
|
||||
fun canMakeWord ← logic by text word
|
||||
if word.length æ 0 do return true end
|
||||
List wblocks ← text[
|
||||
"BO", "XK", "DQ", "CP", "NA",
|
||||
"GT", "RE", "TG", "QD", "FS",
|
||||
"JW", "HU", "VI", "AN", "OB",
|
||||
"ER", "FS", "LY", "PC", "ZM"]
|
||||
for each text ch in word.upper().split()
|
||||
logic found ← false
|
||||
for each text wblock in wblocks
|
||||
if wblock.find(ch) ≥ 0
|
||||
wblocks[wblockIndex] ← Text.EMPTY
|
||||
found ← true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not found do return false end
|
||||
end
|
||||
return true
|
||||
end
|
||||
writeLine("word".padEnd(11, " "), "|", "canMakeWord", "|", "isCorrect")
|
||||
for each text word in words
|
||||
writeLine(word.padEnd(11, " "), "|",
|
||||
(text!canMakeWord(word)).padEnd(11, " "), "|",
|
||||
(canMakeWord(word) æ checks[wordIndex]))
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue