MagOrMin – an old php based game

This is an ooooooold (let’s call it) game I explained for a web programming class in 2003 or 2004.

It was made to explain some basics about Php, sessions, MySql and styles. All in one.

That’s how students learn… all in one and with a real world example.

It’s just a “guess if next number will be higher or slower than the current one” concept, the same that I applied to GuessNext last year.

It’s called MagOrMin and the name comes from the italian translation of “higher” (maggiore) and “lower” (minore).

MagOrMin

Simply click to say if next number will be higher or lower, gain extra lives and compete for the high scores.

I plan to port the game in Ajax, adding a so-called “Web 2.0” style and convert it into a Facebook application with all features… you know… I must monetize everything…

Meanwhile here it is the source code:

I’ll explain the entire process to convert it into a Facebook app.

  • Nice game.

    On line 13, you should use a function to get your number and/or make a loop to get a number that is not the old one because 1 is neither higher or lower than 1.

    For your CSS, you could either use 2 classes for the wrong number (ex : with classes number and wrong set) or you could set everything that is common for both classes and then set what is different for each of them.

    Beside that, nice game.

  • Simple and good working game, but i recommend to use mt_rand instead of rand, because its faster and more random :)