Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
30
Task/ABC-Problem/MAXScript/abc-problem-3.max
Normal file
30
Task/ABC-Problem/MAXScript/abc-problem-3.max
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
fn isWordPossible2 word =
|
||||
(
|
||||
Blocks = #("BO","XK","DQ","CP","NA", \
|
||||
"GT","RE","TG","QD","FS", \
|
||||
"JW","HU","VI","AN","OB", \
|
||||
"ER","FS","LY","PC","ZM")
|
||||
word = toupper word
|
||||
local pos = 1
|
||||
local solvedLetters = #()
|
||||
while pos <= word.count do
|
||||
(
|
||||
for i = 1 to blocks.count do
|
||||
(
|
||||
if (matchpattern blocks[i] pattern:("*"+word[pos]+"*")) then
|
||||
(
|
||||
deleteitem blocks i
|
||||
appendifunique solvedLetters pos
|
||||
pos +=1
|
||||
exit
|
||||
)
|
||||
else if i == blocks.count do return false
|
||||
)
|
||||
)
|
||||
if solvedLetters.count == word.count then
|
||||
(
|
||||
local check = ""
|
||||
for bit in solvedLetters do append check word[bit]
|
||||
if check == word then return true else return false
|
||||
) else return false
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue