初めてのHaskellでの作業と私は、この問題に実行し続けると「(B0、[シャア]」)期待されるタイプと一致しませんでした:は、実際の型は「[[シャア]]」
Couldn't match expected type `([Char], b0)'
with actual type `[[Char]]'
In the first argument of `fst', namely `moves'
In the second argument of `rotatedMaze', namely `(fst moves)'
を私ができますどんなことが起こっているのかよく分かりません。パラメータエラーはどこですか?
manyPlayersManyRotations :: [[Char]] -> [[Char]] -> [[Char]]
manyPlayersManyRotations maze moves =
if null moves
then maze
else
let
rmaze = rotatedMaze maze (fst moves)
drop1 = dropPlayer rmaze '1'
opor1 = (fst drop1, snd drop1)
drop2 = dropPlayer (fst opor1) '2'
opor2 = (fst drop2, snd opor2 || snd drop2)
drop3 = dropPlayer (fst opor2) '3'
opor3 = (fst drop3, snd opor2 || snd drop3)
drop4 = dropPlayer (fst opor3) '4'
opor4 = (fst drop4, snd opor2 || snd drop4)
in
if (not)(snd opor4)
then fst opor4
else manyPlayersManyRotations (fst opor4) (tail moves)
rotatedMaze :: [[Char]] -> [Char] -> [[Char]]
rotatedMaze maze move =
if move == ['c']
then rc maze
else if move == ['c','c']
then rcc maze
else r180 maze
ありがとうございます!そこに頭を使う必要があることを忘れてしまった。あなたは命の恩人です! – iHowell