Lets say I have a string ‘COLIN’.
The numeric value of this string would is worth:
3 + 15 + 12 + 9 + 14 = 53.
So
A = 1, B = 2, C = 3, and so on.
I have no idea how to even start in F# for this.
let mutable nametotal = 0 let rec tcalculate name = name.ToString().ToCharArray() |> Seq.length
Here is what I have so far. The seq.length is just there for testing to see if the toCharArray actually worked.
If the ‘mapping’ is more arbitrary, you could use a strategy like the code below, where you can specify a data structure of what value each letter maps to.