learning F#, it seems pretty cool, favourite functional language so far.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lachlan Jacob 84aff18ec2 Some more exercism problesm done 5 年之前
..
README.md Some more exercism problesm done 5 年之前
ScrabbleScore.fs Some more exercism problesm done 5 年之前
ScrabbleScore.fsproj Some more exercism problesm done 5 年之前
ScrabbleScoreTests.fs Some more exercism problesm done 5 年之前

README.md

Scrabble Score

Given a word, compute the Scrabble score for that word.

Letter Values

You’ll need these:

Letter                           Value
A, E, I, O, U, L, N, R, S, T       1
D, G                               2
B, C, M, P                         3
F, H, V, W, Y                      4
K                                  5
J, X                               8
Q, Z                               10

Examples

“cabbage” should be scored as worth 14 points:

  • 3 points for C
  • 1 point for A, twice
  • 3 points for B, twice
  • 2 points for G
  • 1 point for E

And to total:

  • 3 + 2*1 + 2*3 + 2 + 1
  • = 3 + 2 + 6 + 3
  • = 5 + 9
  • = 14

Extensions

  • You can play a double or a triple letter.
  • You can play a double or a triple word.

Running the tests

To run the tests, run the command dotnet test from within the exercise directory.

Autoformatting the code

F# source code can be formatted with the Fantomas tool.

After installing it with dotnet tool restore, run dotnet fantomas . to format code within the current directory.

Further information

For more detailed information about the F# track, including how to get help if you’re having trouble, please visit the exercism.io F# language page.

Source

Inspired by the Extreme Startup game https://github.com/rchatley/extreme_startup