Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/ABC-problem/Arturo/abc-problem.arturo
Normal file
26
Task/ABC-problem/Arturo/abc-problem.arturo
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
blocks: map [
|
||||
[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]
|
||||
] => [ join map & => [to :string &]]
|
||||
|
||||
charInBlock: function [ch,bl][
|
||||
loop.with:'i bl 'b ->
|
||||
if contains? b upper ch [
|
||||
return i
|
||||
]
|
||||
return ø
|
||||
]
|
||||
|
||||
canMakeWord?: function [wrd][
|
||||
ref: new blocks
|
||||
loop split wrd 'chr [
|
||||
cib: charInBlock chr ref
|
||||
if? cib = ø [ return false ]
|
||||
else [ ref: remove ref .index cib ]
|
||||
]
|
||||
return true
|
||||
]
|
||||
|
||||
loop ["A" "BaRk" "bOoK" "tReAt" "CoMmOn" "SqUaD" "cONfUsE"] 'wrd
|
||||
-> print [wrd "=>" canMakeWord? wrd]
|
||||
Loading…
Add table
Add a link
Reference in a new issue