Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
33
Task/ABC-Problem/PicoLisp/abc-problem.l
Normal file
33
Task/ABC-Problem/PicoLisp/abc-problem.l
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
(setq *Blocks
|
||||
'((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) ) )
|
||||
(setq *Words '("" "1" "A" "BARK" "BOOK" "TREAT"
|
||||
"Bbb" "COMMON" "SQUAD" "Confuse"
|
||||
"abba" "ANBOCPDQERSFTGUVWXLZ") )
|
||||
|
||||
(de abc (W B)
|
||||
(let Myblocks (copy B)
|
||||
(fully
|
||||
'((C)
|
||||
(when (seek '((Lst) (member C (car Lst))) Myblocks)
|
||||
(set @)
|
||||
T ) )
|
||||
(chop (uppc W)) ) ) )
|
||||
|
||||
(de abcR (W B)
|
||||
(nond
|
||||
((car W) T)
|
||||
((car B) NIL)
|
||||
(NIL
|
||||
(setq W (chop W))
|
||||
(let? I
|
||||
(find
|
||||
'((Lst) (member (uppc (car W)) Lst))
|
||||
B )
|
||||
(abcR (cdr W) (delete I B)) ) ) ) )
|
||||
|
||||
(for Word *Words
|
||||
(println Word (abc Word *Blocks) (abcR Word *Blocks)) )
|
||||
|
||||
(bye)
|
||||
Loading…
Add table
Add a link
Reference in a new issue