On Wed, Jun 11, 2008 at 09:10:00PM -0600, Wade Preston Shearer wrote:
>This comes up every month at PLUG (for door prizes) so I thought I'd  
>ask here.  What's an easy to remember way to generate a random  
>number between 1 and some given number.  Language doesn't matter so  
>long as the code is easy enough for someone to remember the entire  
>thing and type it up at the drop of a hat.

how about in bash? what, you didn't know bash had a built-in $RANDOM function? 

echo $[$RANDOM % 100 + 1]

-peter

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to