anchor.diff:  ﻿module Connect4
  -
  -open Connect4Challenge
  -//open Array2D
  -
  -type Move =       
  -   | Invalid of string          
  -   | Valid
  -   
  -type MoveResult =
  -    | Won of (int*int) list //return the coordinates
  -    | None
  -
  -let isValidMove column pitch = 
  -    match column with
  -    | i when i < 0 || i > Array2D.length1 pitch  -> Invalid("Just columns between 0 and " + ((Array2D.length1 pitch)-1).ToString() + " are Valid.\n Given: " + i.ToString()) // between 0 and 6 (on an 7x6 pitch)
  -    | i when pitch.[i, Array2D.length2 pitch] <> 0 -> Invalid("Column " + i.ToString() + " is Full.") // check if column is full
  -    | _ -> Valid
  -
  -let makeMove column (pitch: int[,]) = 
  -    let rec testLoop currentLineIndex=
  -        match currentLineIndex with
  -        | i when pitch.[column, i] = 0 -> pitch.[column, i] <- 1 // 1 = yours, 0 = empty, -1 = theirs
  -                                          pitch
  -        | i -> testLoop (i+1)
  -    testLoop 0
   
   (*
       1 = yours
  
positive.code:         5. ..                               
  *)
  
  
  let getValuesWithIndices startX nextX startY nextY howManyInARow (pitch: int[,]) =
              let rec loop x y currentIteration acc =
  
negative.code:                        loop (nextX x) (nextY y) (i + 1) (valueWithIndices::acc)
              loop startX startY 0 []
  
  let getMoveResult howManyInARow valuesAndIndices = let sum = valuesAndIndices 
                                                                  |> List.map (fun (value,_) -> value)
                                                                  |> List.reduce (fun acc elem -> acc + elem)
  