Coding Duel for Fun with Pex

Pex for fun is a simplified version of Pex. Nothing to do with any installation for playing with this and just log in to and play. Code editor supports C#,Visual Basic and F#, also intellisense capabilities are avalable in the editor itself.

Games are puzzles which has their own secret(hidden) implementations. Players can implement the code according to the clues given by Pex. Players can ask from Pex anytime that how close to the hidden or the expected implementation. There are random puzzles that players can picked up and allows new puzzles to be entered to the puzzles list.

These puzzle games are very interactive coding duelsa and it will improve the problem solving capabilities and recalling capabilities as well.

Pex for fun is now avalable in Windows Mobile.

 Pex In Windows Mobile
Lets see how to play and solve a puzzle.I got following puzzle and the Puzzle method getting one integer parameter and returns it. The puzzle has hiden its implementation.

 Pex For Fun
To get any clue about the secrect implementation I Asked from Pex for the first time by Clicking on “Ask Pex!”. I got following table with input, my result, scret implementation result, Exceptions and Error messages.
 Ask Pex
I tried to write the code to excactly match to the input and the secret implementation result given by Pex. Then it gave following table after compiling the code and after analyzing the code.
 Trying To Solve the Puzzle
The results from Pex looked good to me and I felt that I have come very closer. Realized the pattern of the secret implementation. The puzzle gets the Factorial Value of the given integer.
Wrote the code to get the Factorial Value from the integer goes in to the Puzzle method and asked from Pex to confirm my implementation is correct. Yes it was!
 Factorial Win
Just try it. It’s Fun.

Author: Indika Abayarathne

MSc in IT [University of Colombo] Solutions Architect | Consultant Technologies: Power Platform | Dynamics CE | Azure

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: