|
|
|
@ -10,10 +10,10 @@ TestInput ←
|
|
|
|
|
# Original parsing solution
|
|
|
|
|
Colors ← {"red" "green" "blue"}
|
|
|
|
|
Parse ← (
|
|
|
|
|
⊔⊢⇌↘1 regex "Game (\\d+): (.*)"
|
|
|
|
|
⊜(□⊜(⇌⊜((parse⊔⋅∘|⊙;)<3.⊃(⊗⊙Colors|∘)□)≠@ .)≠@,.)≠@;.
|
|
|
|
|
°□⊢⇌↘1 regex "Game (\\d+): (.*)"
|
|
|
|
|
⊜(□⊜(⇌⊜((⋕°□⋅∘|⊙;)<3.⊃(⊗⊙Colors|∘)□)≠@ .)≠@,.)≠@;.
|
|
|
|
|
≡(
|
|
|
|
|
∧(⍜⊡+⊙:⍘⊟)⊃⊔0_0_0
|
|
|
|
|
∧(⍜⊡+⊙:°⊟)⊃°□0_0_0
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ Parse ← (
|
|
|
|
|
ColorsII ← "rgb"
|
|
|
|
|
ParseII ← (
|
|
|
|
|
↘+2⊗@:.
|
|
|
|
|
⬚0⊜(⊕∘⍘⊟⍉∵(⊟⊃(⊗⊙ColorsII⊢|parse↘2)⇌⊔) regex "\\d+ [rgb]")≠@;.
|
|
|
|
|
⬚0⊜(⊕∘°⊟⍉∵(⊟⊃(⊗⊙ColorsII⊢|⋕↘2)⇌°□) regex "\\d+ [rgb]")≠@;.
|
|
|
|
|
↯¯1_3
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|