Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
// Variable declaration reset. Nigel Galloway: June 21st 2022
|
||||
let s=[1;2;2;3;4;4;5]
|
||||
// First let me write this in real F#, which rather avoids the whole issue
|
||||
printfn "Real F#"
|
||||
s|>List.pairwise|>List.iteri(fun i (n,g)->if n=g then printfn "%d" (i+1))
|
||||
// Now let me take the opportunity to write some awful F# by translating the C++
|
||||
printfn "C++ like awful F#"
|
||||
let mutable previousValue = -1
|
||||
for i in 0..s.Length-1 do
|
||||
let currentValue=s.[i]
|
||||
if previousValue = currentValue then printfn "%d" i
|
||||
previousValue <- currentValue
|
||||
Loading…
Add table
Add a link
Reference in a new issue