cell :: (Int Int Int Int {#String} -> Bool) (Int -> Bool) (Int -> Bool) {#String} -> {#String}
cell lookfun live die ls
- # ls` = {{step x y\\x<-[0..size ls.[0] - 1]}\\y<-[0..size ls - 1]}
+ # ls` = {{step x y\\x<-[0..size ls.[y] - 1]}\\y<-[0..size ls - 1]}
= if (and [l==r\\l<-:ls` & r<-:ls]) ls (cell lookfun live die ls`)
where
step x y = case ls.[y,x] of
seat :: Int Int {#String} -> Char
seat x y ls
- | x < 0 || x >= size ls.[0] || y < 0 || y >= size ls = '-'
+ | y < 0 || y >= size ls || x < 0 || x >= size ls.[y] = '-'
= ls.[y,x]