YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,7 +1,8 @@
|
|||
fun abc(str, list):
|
||||
if list.isEmpty: return true
|
||||
for i in indices(list) where s[!1] in list[i]:
|
||||
return abc(str[:!2], remove(val list, i))
|
||||
if list.isempty:
|
||||
return true
|
||||
for i in indices(list) where s[end] in list[i]:
|
||||
return abc(str[end-1:], remove(val list, i))
|
||||
false
|
||||
|
||||
let test = ["A", "BARK","BOOK","TREAT","COMMON","SQUAD","CONFUSE"]
|
||||
|
|
@ -9,4 +10,4 @@ let list = ["BO","XK","DQ","CP","NA","GT","RE","TG","QD","FS",
|
|||
"JW","HU","VI","AN","OB","ER","FS","LY","PC","ZM"]
|
||||
|
||||
for str in test:
|
||||
print "$:>8(s) | $(abc(s, list))"
|
||||
print "$|>8|{s} | ${abc(s, list)}"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ extension op
|
|||
]
|
||||
}
|
||||
|
||||
public program =
|
||||
public program
|
||||
[
|
||||
var blocks := ("BO", "XK", "DQ", "CP", "NA",
|
||||
"GT", "RE", "TG", "QD", "FS",
|
||||
|
|
@ -33,5 +33,5 @@ public program =
|
|||
words forEach(:word)
|
||||
[
|
||||
console printLine("can make '",word,"' : ",word canMakeWordFrom:blocks).
|
||||
].
|
||||
].
|
||||
]
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue