Lottery TicketsCall me paranoid, but I don’t really trust the ‘lucky dip’ feature offered for choosing lottery numbers. So some time ago I built a couple of lottery number generators using server-side code – mostly as a learning experience.¬†They worked ok but weren’t pretty.

Since the UK National Lottery was recently changed from 1-49 to 1-59 I decided to rewrite the generator as a client-side web page using only javascript. This time there are some enhancements. Primarily, I have added configuration options that allow the page to generate lottery numbers to suit many styles of lottery game. I have also added default buttons that set up the page for either UK National Lottery or the Euromillions Lottery at the click of a button.

Within the lottery ticket generator itself, the numbers are now sorted in ascending order and there is an extra level of randomness thrown in as the generator picks a random number from a group of other random numbers, rather than just grabbing the first random number it generates.

OK – so give it a try (and let me know if you win)!

Try the new National Lottery Number Generator