Advertisement
Guest User

F# er sjukt

a guest
Jul 6th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.35 KB | None | 0 0
  1. for i in [1..6] do
  2.     let printMsg =
  3.         match i with
  4.         | 0 -> "Good job, Eat Healthy food."
  5.         | 1 -> "One cookie won't hurt you."
  6.         | 2 -> "Two cookies are a nice snack."
  7.         | n when n > 2 -> n.ToString() + " cookies are way to many!"
  8.         | _ -> failwith("Number out of expected range!")
  9.     printfn "%s" printMsg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement