Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 121881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:02:26+00:00 2026-05-11T04:02:26+00:00

Lets say I have a string COLIN. The numeric value of this string would

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:02:27+00:00Added an answer on May 11, 2026 at 4:02 am

    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.

    #light  let table = [     'C', 3     'O', 15     'L', 12     'I', 9     'N', 14     ]  let dictionary = dict table  let Value c =      match dictionary.TryGetValue(c) with     | true, v -> v     | _ -> failwith (sprintf 'letter '%c' was not in lookup table' c)  let CalcValue name =     name |> Seq.sum_by Value  printfn 'COLIN = %d' (CalcValue 'COLIN') 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have an array like this: string [] Filelist = ... I
How do you split a string? Lets say i have a string dog, cat,
Lets say I have the following code: abstract class Animal case class Dog(name:String) extends
Lets say I have a Dictionary object: Dictionary myDictionary<int, SomeObject> = new Dictionary<string, SomeObject>();
I have a method lets say: private static String drawCellValue( int maxCellLength, String cellValue,
Let's say I have a string holding a mess of text and (x)HTML tags.
Let's say I have a class: class Foo { public string Bar { get
Let's say I have an integer that I need to convert to a string
Lets say i have the following scenario: public class A { public String createString(final
I have a string which contains, lets say word key 5 times. Each time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.