Beginner Projects
Prerequisites: Level 1 — Beginner
Build these on your own using what you learned in Level 1. Each one uses values, functions, pipelines, lists, pattern matching, and options.
1. Number Guessing Game
Pick a random number from 1 to 100 with System.Random, read guesses with
Console.ReadLine, answer "higher" or "lower", and count the attempts.
Use System.Int32.TryParse and a match so input that isn't a number is
handled instead of crashing.
2. Tip Calculator
Ask for a bill amount and a tip percentage, then print the tip and the
total as decimal values formatted to two places. Write the calculation
as small functions and connect them with |>.
3. Word Frequency Counter
Split a paragraph into words, normalize them to lower case, and print the
five most common words with List.countBy, List.sortByDescending, and
List.truncate — all in a single pipeline.
4. Grade Book
Store students as tuples of a name and a list of scores. Compute each
average, turn it into a letter grade with a match on ranges, and print a
report aligned in columns with printfn "%-10s %6.1f".
5. FizzBuzz, Three Ways
Write FizzBuzz with a for loop, with List.map over a range, and with a
match on the tuple (n % 3, n % 5). Compare which version reads best.