我对我在这里想念的东西感到困惑。我是Elm的新手,但我不明白这怎么可能是错误的:
move : List Char -> Char -> Int
move board symbol =
let
grid =
fromList board
found =
((get 0 grid == symbol) && (get 1 grid == symbol) && (get 2 grid == symbol))
|| ((get 4 grid == symbol) && (get 4 grid == symbol) && (get 5 grid == symbol))
in
if found then
1
else
0
错误:
The = operator is reserved for defining variables. Maybe you want == instead? Or
maybe you are defining a variable, but there is whitespace before it?
14| found =
^
Maybe <http://elm-lang.org/docs/syntax> can help you figure it out.
Detected errors in 1 module.
答案 0 :(得分:5)
Elm对缩进很敏感。
grid
子句中的found
和let
的声明必须具有相同的缩进,但是found
的缩进空间比grid
多。
尝试删除空格,使这两个声明对齐。