It isn't so easy at all though...
Not if you want to take in account the very easy way of cheating with this.
Threads about this exist, which also began with "it's dead easy". The cheating problems with implementing this kind of games is also discussed there.