Hi I am wanting to create in F# a 2D array of size 1000x1000, with the value in the array at any position to be initialized as the same vaue of its index using the 2DArray class.
i.e. position [1,1] would have value (1,1).
I have looked at the syntaxt of Array2D.create, but am not sure how to use it properly...
Any help would be appreciated...
Use Array2D.init to pass a function to specify the initial value of each.
let a = Array2D.init 3 3 (fun x y -> (x,y))
printfn "%A" a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With