代码之家  ›  专栏  ›  技术社区  ›  PositiveGuy

右侧有多个或语句

elm
  •  1
  • PositiveGuy  · 技术社区  · 8 年前

    我对我在这里丢失的东西感到困惑。我是榆树的新手,但我不知道这是怎么回事:

    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. 
    
    1 回复  |  直到 8 年前
        1
  •  5
  •   Luke Woodward    8 年前

    grid found let

    推荐文章