Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
24
Task/ABC-Problem/Icon/abc-problem.icon
Normal file
24
Task/ABC-Problem/Icon/abc-problem.icon
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
procedure main(A)
|
||||
blocks := ["bo","xk","dq","cp","na","gt","re","tg","qd","fs",
|
||||
"jw","hu","vi","an","ob","er","fs","ly","pc","zm",&null]
|
||||
every write("\"",word := !A,"\" ",checkSpell(map(word),blocks)," with blocks.")
|
||||
end
|
||||
|
||||
procedure checkSpell(w,blocks)
|
||||
blks := copy(blocks)
|
||||
w ? return if canMakeWord(blks) then "can be spelled"
|
||||
else "can not be spelled"
|
||||
end
|
||||
|
||||
procedure canMakeWord(blks)
|
||||
c := move(1) | return
|
||||
if /blks[1] then fail
|
||||
every i := 1 to *blks do {
|
||||
if /blks[i] then (move(-1),fail)
|
||||
if c == !blks[i] then {
|
||||
blks[1] :=: blks[i]
|
||||
if canMakeWord(blks[2:0]) then return
|
||||
blks[1] :=: blks[i]
|
||||
}
|
||||
}
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue