【发布时间】:2014-07-19 16:33:31
【问题描述】:
在实现“河内塔”问题的代码时,我收到以下错误消息:
hanoi.hs:4:24: parse error on input `='
Failed, modules loaded: none.
代码如下:
hanoi 1 i j = [(i, j)]
hanoi n i j = hanoi n' i otherT ++ [(i,j)] ++ hanoi n' otherT j
where n' = n-1
otherT = 1+2+3-i-j
有什么想法吗?
【问题讨论】:
-
好像你有混合制表符和空格。
标签: haskell recursion towers-of-hanoi