右侧多个 OR 语句
Multiple OR Statements on Right Side
我对这里缺少的东西感到困惑。我是 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.
Elm 对缩进很敏感。
let
子句中 grid
和 found
的声明必须具有相同的缩进,但 found
比 space 多缩进一个grid
.
尝试删除一个 space 以使这两个声明对齐。
我对这里缺少的东西感到困惑。我是 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.
Elm 对缩进很敏感。
let
子句中 grid
和 found
的声明必须具有相同的缩进,但 found
比 space 多缩进一个grid
.
尝试删除一个 space 以使这两个声明对齐。