Dyalog APL
This is an implementation of ordered dither with a special dither array.
The input format is a restricted form of raster PGM while it is also the default style produced by Netpbm programs that requires no comment line, file header separated by newline character rather than arbitrary wh...
> the first number called will always be 0, as will be the centre space of all of the cards. this emulates the "free space" from the real game. > there will always be a winner, and the game will always end when the last number is called.
i feel like one could take advantage of these somehow.
B←?10000 5 5⍴100
N←?⍨100
]runtime -c 'B ((⊃⍤⍋⌈⌿⍤2⌊/⍤⌊⌈/)⍳⍨) N' 'B {⊃∊⍺∘{⍸∨/5=(+/,+⌿)⍤2∨⌿⍺=⍤3 0⊢⍵}¨,\⍵} N'
B ((⊃⍤⍋⌈⌿⍤2⌊/⍤⌊⌈/)⍳⍨) N → 1.0E¯3 | 0%
B {⊃∊⍺∘{⍸∨/5=(+/,+⌿)⍤2∨⌿⍺=⍤3 0⊢⍵}¨,\⍵} N → 1.6E0 | +164800% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
B←?10000 5 5⍴100
N←?⍨100
]runtime -c 'B {(⊃⍤⍋⌈⌿⍤2⌊/⍤⌊⌈/)⍵⍳⍺} N' 'B {⊃∊⍺∘{⍸∨/5=(+/,+⌿)⍤2∨⌿⍺=⍤3 0⊢⍵}¨,\⍵} N'
B {(⊃⍤⍋⌈⌿⍤2⌊/⍤⌊⌈/)⍵⍳⍺} N → 1.0E¯3 | 0%
B {⊃∊⍺∘{⍸∨/5=(+/,+⌿)⍤2∨⌿⍺=⍤3 0⊢⍵}¨,\⍵} N → 1.0E0 | +103450% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕