1
dashboard.Grid
|> Seq.mapi ^-^ fun y sx -> 
    sx  |> Seq.mapi ^-^ fun x s -> 
        if not <| s.IsEmpty && s.CellState.Color = color then 
            let psteps = s.CellState.motion( dashboard, new SPosition(x,y), color )
            if psteps <> null then
                if psteps.IsEmpty then
                    Some(psteps)
                else
                    None
            else None
        else None
    |> Seq.choose id
|> Seq.collect(fun x -> x)
|> Seq.collect(fun x -> x)

だから、私はこのシーケンスの最後の部分 (2 つの文字列) がおかしいと思います。別の方法でシーケンスを開くことはできますか? List.ofSeq() はここでは機能しません。

ありがとうございました。

4

1 に答える 1

5

(または)Seq.concatと同じ、を探していると思います。Seq.collect(fun x -> x)Seq.collect id

于 2011-05-23T12:26:38.393 に答える