module Hanoi
where
makeGame :: Int -> Int -> [[Int]]
makeGame l _=[[]]
makeGame x y = [[1..y] ]++ makeGame (x-1) 0
moveRing :: (([[Int]], Int, Int)->[[Int]]
moveRing (xs,y,z) = if (y
take (y-1) xs ++ [(tail (xs!!(y-1)))] ++dropy(take (z-1) xs)++ [(head (xs!!(y-1)) ):(xs!!(z-1))] ++dropzxs
else
take (z-1)xs++[(head (xs!!(y-1)) ) :(xs!!(z-1))]++dropz(take (y-1) xs)++[tail (xs!!(y-1))]++dropyxs
approvedMove :: ([[Int]],Int,Int)-> Bool
approvedMove (xs,y,z) = if (y>length xs ||z>length xs) thenFalse
else
if (xs!!(y-1[] then False
else
if (xs!!(z-1))==[] then True
else
ifhead(xs!!(y-1))< head="" (xs!!(z-1))="">
elseFalse
startGame :: IO [[Int]]
startGame = do
putstrLn("Let's play tower of Hanoi. Write the number of towers:")
x<>
putstrLn("Write numbers of rings:")
y<>
putstrLn("you choosed "++ x ++"towers and "++ y ++" rings")
putstrLn("starting game")
return (makeGame (read x::Int) (read y::Int))
playingGame :: [[Int]]->IO [[Int]]
playingGame xss= if (all null (init xss)) then
do
showHanoixss
putstrLn("you won")
returnxss
else
do
showHanoixss
putstrLn("enter the stick you want to move from:")
x<>
putstrLn("enter stick to move to:")
y<>
and the error i need help to fix is in the picture
Extracted text: Hanoi.hs:9:1: error: parse error (possibly incorrect indentation or mismatched brackets) 9 | moveRing (xs,y,z) = if (y
Extracted text: module Hanọi where makeGame :: Int -> Int -> [[Int]] makeGame l _=[[]] makeGame x y = [[1..y] ]++ makeGame (x-1) 0 moveRing :: (([[Int]], Int, Int)->[[Int]] moveRing (xs,y,z) = if (y