Visual F# 100 Examples: Example Number 7

So far I have been sharing to you guys some examples of Window Based application in Visual F#. This time, for variation sake lets make some console application:

Problem: Make a simple console application mind reader game.
  1. open System  
  2. //change the title to Simple Mind Reader Game  
  3. System.Console.Title<-"Simple Mind Reader Game"  
  4. //change the foreground color to cyan  
  5. Console.ForegroundColor<-ConsoleColor.Cyan  
  6. //dislay the game title screen  
  7. printfn "\t\t\t Mind Reader Game"  
  8. printfn "\t\t\tPress enter to continue..."  
  9. //waits for a keypress from the user  
  10. System.Console.ReadLine()|>ignore  
  11. System.Console.Clear()  
  12. //the following does the game action sequence  
  13. printfn "\t\t\t Think of a five-digit number that has five unique numbers(Eg. 12345)"  
  14. printfn "\t\t\tPress enter to continue..."  
  15. System.Console.ReadLine()|>ignore  
  16. System.Console.Clear()  
  17.   
  18. printfn "\t\t\t Reverse the numbers then subtract the smaller number from the larger number(Eg.54321- 12345)"  
  19. printfn "\t\t\tPress enter to continue..."  
  20. System.Console.ReadLine()|>ignore  
  21. System.Console.Clear()  
  22.   
  23. printfn "\t\t\t Add 10000 to the difference"  
  24. printfn "\t\t\t Press enter to continue..."  
  25. System.Console.ReadLine()|>ignore  
  26. System.Console.Clear()  
  27.   
  28. printfn "\t\t\tVisualize the sum while I try to read your mind."  
  29. printfn "\t\t\tPress enter to continue..."  
  30. System.Console.ReadLine()|>ignore  
  31. System.Console.Clear()  
  32.   
  33. printfn "\t\t\tThe sum is…"  
  34. printfn "\t\t\tPress enter to continue..."  
  35. System.Console.ReadLine()|>ignore  
  36. System.Console.Clear()  
  37.   
  38. printfn "\t\t\tThe sum is…"  
  39. printfn "\t\t\tPress enter to continue..."  
  40. System.Console.ReadLine()|>ignore  
  41. System.Console.Clear()  
  42.   
  43. printfn "\t\t\tThe sum is…"  
  44. printfn "\t\t\tPress enter to continue..."  
  45. System.Console.ReadLine()|>ignore  
  46. System.Console.Clear()  
  47.   
  48. printfn "\t\t\t51976"