Author Topic: Challenge: Old topic, New life - Random numbers  (Read 1757 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Swamp Rat
  • Posts: 566
Challenge: Old topic, New life - Random numbers
« on: May 02, 2006, 03:39:52 PM »
I was a wonder'n if I could bring back to life a topic brought up a while back.
The topic of random numbers.

Just for kicks, how would you go about writing a routine for running a "fair" coin toss ??
My thoughts were to get a random number from 0.0001 to 9.9999 with the 'less than' 5.0000 is heads and 'greater than' 5.0001 is tails.

Or how about a set of 6 sided dice ??
Prompt the user for a choice of one to two dice.
Each die roll generating a random number from 1 to 6.

How would you go about creating this ??   :lol:
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Maverick®

  • Seagull
  • Posts: 14778
Re: Challenge: Old topic, New life - Random numbers
« Reply #1 on: May 02, 2006, 03:51:56 PM »
  That sounds alot like an assignment I had in high school we had to write in basic.   :-D

ronjonp

  • Needs a day job
  • Posts: 7531

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC