再帰関数を実装していますが、停止条件を(2*scope)にする必要があります。これは関数のパラメーターです。
sortByManhattanDistance agent (2*scope) scope xs sortedNearFoodList = sortedNearFoodList
sortByManhattanDistance agent n scope xs sortedNearFoodList = sortByManhattanDistance agent (n+1) scope xs (sorted ++ sortedNearFoodList)
where sorted=compareManhattanDistance xs agent n
そして抱擁は次のように不平を言います:Syntax error in declaration (unexpected symbol "*")
それは、パラメーターに対していくつかの関数を使用できないということですか?
前もって感謝します