[TIB] Re: AI


[Prev][Next][Index][Thread]

[TIB] Re: AI



Yea, I did this in my "Final Fantasy" game... I am just interested in trying something more difficult, and also it could carry over to my Palm programming (attempting to write C on my Visor)
 
RaptorDrew
----- Original Message -----
From: MyOwnLittlWorld@aol.com
To: ti-basic@lists.ticalc.org
Sent: Saturday, June 14, 2003 9:45 PM
Subject: [TIB] Re: AI

well, the easiest way is to just use good old random #s...  perhaps you could weight the different actions differently if you wanted relative percents...

The sensible way:
rand -> A
If A>.9
Disp "action 1! - A 10% chance!"
If A>.7 and A<=.9
Disp "Action 2! - A 20% chace!"

or, the fly by night way...
If rand>(1/3)
Then
Disp "action 1! A 33% chace!"
Else
If rand>.5
Then
Disp "action 2!  A 33% chance!"
Else
Disp "action 3!  A 33% chance!"
End
End

(the second way's my favorite for no good reason at all.)
Nick

Follow-Ups: References: