The Pex team has created a site that provides a great tool to exercise your brain, learn a bit of code, and see a bit about Pex.
To use it, just go to the PexForFun site. There are puzzles, learning exercises, and duels. Register and you can create your own challenges. (I’ll be doing this over the next month or so.)
The puzzle structure is a great demonstration of Pex. When you start a new puzzle, you have a empty implementation. You can click Ask Pex to get some test results on the hidden successful implementation. Pex then executes those tests on your code. You’ll see some failures, and you can fix your code to make the tests pass.
Then, you can click “Ask Pex” again, and see if a more extensive test suite still passes. Iterating this way gets you to write more code and your implementation gets closer to the expected solution. If you are not familiar with Test Driven Development, I highly recommend it. You’ll get a real feel for creating code to an executable specification instead of a written spec.
All in all, there are several reasons I like playing with PexForFun:
Learn some new techniques, exercise your brain, and most of all: Have fun!
All of these projects are Open Source (using the Creative Commons license for content, and the MIT license for code). If you would like to contribute, visit our GitHub Repository. Or, if you have questions, comments, or ideas for improvement, please create an issue for us.