Tuesday 10 November 2015

Code spippets - Fsharp

GistBox Clipper

Clipper is the companion Chrome extension to GistBox. It allows users to create Gists from:

  • Example code blocks
  • Highlighted text
  • Any page on the web
Install Chrome Extension
http://www.gistboxapp.com/clipper-tutorial/
Enter keyboard data, via console, with validation.
/// Read a valid age (between 0 and 150) from key input let readage (person: string) = let mutable continueLooping = true let mutable age = 0 while continueLooping do Console.WriteLine("Enter {0}'s age (between 0 and 150): ", person) let canparse, keyin = Int32.TryParse(Console.ReadLine()) age <- keyin if canparse && age >= 0 && age < 151 then continueLooping <- false age

No comments:

Post a Comment