Microsoft has added Pex4Fun to the Marketplace and it’s a game based around writing proper code:
Win points by writing code! You earn points when your code computes the right outputs for all inputs. Pex4fun features a code editor with auto-completion, snippets and background compilation to make programming on the phone a reality. If you are new to programming in general, don’t worry: Pex4fun also features a set of courses to learn the basics and beyond right from your phone.
Neat concept and of course, it’s free.