-let rec userMakesAChoice prompt selectionValidator validOptions =
- match validTargets with
- let result = Console.ReadLine()
- match selectionValidator result validOptions with
- | None -> userMakesAChoice prompt selectionValidator validOptions
-let prompt numbers = numbers |> List.iter (fun x -> "%A" x)
-// Defining valid options
-let options = [2; 3; 4; 5;]
-// Defning selection validator
-let selectionValidator selection options =
- match selection |> Int32.TryParse with
- | (true, value) -> options |> List.tryFind (fun x -> x = value)
-userMakesAChoice prompt selectionValidator options