Tomorrow I am asking my Computer Science & Engineering students to solve this small programming problem:
Write a function in C which returns a random integer between 1 and 20. One extremely important caracteristic of the function is that it must return a different integer each time it is called. This, obviously, implies that it can only be called twenty times.
There is a second part (and in my opinion it is the coolest part):
Write the same function using a more modern programming language (e.g. Ruby).
Care to give this a go?
(Image courtesy of Sega Japan)