rand() is the c function that will generate your random numbers; simply include <stdlib.h>, seed your generator with srand(12345), and successive calls to rand() will return an integer in the range [0,RAND_MAX]. To scale that back to the range you want (e.g. if you want numbers between 1-100)...
Sciguy:
I can't speak on the agar solution, but I think the commercial product you're thinking of is Magic Plastic Bubbles: http://explore4fun.com/magplasbub.html
Hope that helps,
/m