I'm newbie to Haskell and write the following small code but it failed with loop exception. The problem is the code doesn't use the loop , even recursion. That's make me crazy!
gameList :: [Int]->Int->Int->[(Int, Int)]
gameList org pos step =
let next = (mod (pos + step) 2) ;
pos = next;
in [(pos, pos)]
Then save it in one file and succeed to load it into GHC with interactive mode.
invoke it like this
gameList [1,2,3] 0 1
It will throw error "[(*** Exception: <>"
The GHCI info :WinGHCi 1.0.6 Help me!
posis one of your arguments. What are you trying to do? What is the expected output ofgameList [1,2,3] 0 1?