Flipping bits game: Difference between revisions

m
→‎{{header|Haskell}}: (Slightly reordered imports, for legibility)
(→‎{{header|Haskell}}: Specified imports, applied hlint, hindent)
m (→‎{{header|Haskell}}: (Slightly reordered imports, for legibility))
Line 1,264:
=={{header|Haskell}}==
Maximum game size is 9x9 because the array indices are the characters 1 until 9.
<lang Haskell>import Data.ArrayList (Array, (!), (//), array, boundsintersperse)
 
import DataSystem.ListRandom (intersperserandomRIO)
 
import ControlData.MonadArray (zipWithM_Array, replicateM(!), (//), foldMarray, whenbounds)
 
import Control.Monad (zipWithM_, replicateM, foldM, when)
import System.Random (randomRIO)
 
type Board = Array (Char, Char) Int
Line 1,284:
 
numCols t =
let ((_, a), (_, b)9) = bounds t
in [a .. b]
 
9,659

edits