usually there is a random function in the language, for example randomize in
vb, random in autoit ...
however there are different randomising methods, and some of them may need
to be written out manually.
take an autoit example
$number=random(1,5,1) ;choose a number between 1 and 5
if $number=1 then soundplay("c:\windows\media\ding.wav",1) ;play the ding
and wait until finished
if $number=2 then shutdown(6) ;reboots the computer
if $number=3 then msgbox(0,"heheh","number 3 is your friend") ;display a
message box
if $number=4 then cdtray("d:","open") ;open the cd drive
if $number=5 then beep(262,500) ;beep a middle c for half a second
hth.
regards,
damien
----- Original Message -----
From: "Nicol" <[EMAIL PROTECTED]>
To: "blind gaming" <[email protected]>
Sent: Saturday, November 11, 2006 6:15 PM
Subject: [Audyssey] randomising
> HI all
> I would very much like to know how its possible for the computer to
> randomise. Take a game like pipe2. How did they program the game so that
> the computer randomly choose an item. Randomising sounds to me like a
> supernatural thing. I know that programmers puts if statements into
their
> code: if this happens do this. but how do they write a program to
> randomise; to randomly pick an item from others? I think this is how dice
> games such as jims' games and GMA dice works. The moment you press a key
to
> throw the dice the computer first plays a sound of a dice thrown and
then
> it randomly decides on a number within a range depending on the dice you
> are using, because there could impossibly not be a physical dice in the
cpu.
> How do a programmer tell the computer to randomise? Is it only one
> statement in his code? Does the programmer for instance put a line in
his
> code that tells the computer: randomise?
> Is randomising a function built into the computer or do the programmer
have
> to instruct the computer on how to randomise? because as far as I know, a
> program is a set of instructions which tasks the computer should perform.
I
> can't play pipe2 on my computer if I don't have the program because the
> computer doesn't know how to present pipes to fit and side scrollers
> without instructions. Because randomising is, as far as i know, mostly
> used in games, I thought it would be appropriate to ask it here.
> I'm just curious how it happens that the computer gets its ability to
> randomise within a game.
>
>
> _______________________________________________
> Gamers mailing list .. [email protected]
> To unsubscribe send E-mail to [EMAIL PROTECTED] You can
visit
> http://audyssey.org/mailman/listinfo/gamers_audyssey.org to make
> any subscription changes via the web.
>
>
>
_______________________________________________
Gamers mailing list .. [email protected]
To unsubscribe send E-mail to [EMAIL PROTECTED] You can visit
http://audyssey.org/mailman/listinfo/gamers_audyssey.org to make
any subscription changes via the web.