1,230,576
clicked '
Ask Pex!
'
Sign In
Random Puzzle
Learn
APCS
New
C#
Visual Basic
F#
The code is a puzzle.
Do you understand what the code does? Click
Ask Pex!
to find out.
module Program open System type Expr = Cons of int | Neg of Expr | Add of Expr * Expr | Mul of Expr * Expr | Div of Expr * Expr let rec eval e = match e with | Cons i -> i | Neg e -> -(eval e) | Add(e1,e2) -> eval e1 + eval e2 | Mul(e1,e2) -> eval e1 * eval e2 | Div(e1,e2) -> eval e1 / eval e2 let Puzzle e = // what value of e can cause exceptions? ask Pex to find out! let v = eval e Console.WriteLine v
Permalink
Coding Duel Name:
Help
Community
Live Feed
About
© 2013 Microsoft - Pex v0.94 - .NET v4 -
Terms of Use
-
Privacy