Frage

Ich erhalte die Fehlermeldung „Nicht im Umfang: x“, wenn dabei wie folgt ...

blanks :: Sudoku -> [Pos]
blanks (Sudoku su) = [ fst x | x <- posSud | isBlank (snd x) ]
    where
        isBlank Nothing = True
        isBlank _       = False
        posSud          = zip ixPos (concat su)
        ixPos           = zip ixRows ixCols
        ixCols          = concat (replicate 9 [0..8])
        ixRows          = [floor (x / 9) | x <- [0..81]]

aber wenn ich entferne die Wache der 2:. Nd Linie GHCI Fehler ohne ich kompiliert

Können Sie mir helfen, zu verstehen, was ich falsch mache?

War es hilfreich?

Lösung

try [ fst x | x <- posSud , isBlank (snd x) ]

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top