Check out my
new book!
HTML5 Games book
AppJet + = True JSON randomness Oi, I've been busy for the past week, mostly with doing nothing at all and just enjoying the tail end of the summer. Got some good ideas I need to put some work in now but for now here's another small app I made while messing around with AppJet a few weeks ago.

It's a simple JS gateway to the true random number generator at (created by Mads Haahr). It accesses the API, retrieves a number of random integers (maximum of 100 numbers), turns the response into JSON data and calls a callback function specified by you.

Example usage:

function randomcallback(res) {
alert( "A random number between 1 and 100: " + res.numbers[0] );

<script src="" />

I'm not sure if I'll ever have a use case where a pseudo-random Math.random() call won't do, but usefulness is not really my game anyway..

Check out the application and source here:
⇓ 1 comment rozzzi

Thank you very much for the great information.


January 12, 2009 at 8:16 AM
Post a Comment