Re: [A89: displaying varibles]
[Prev][Next][Index][Thread]
Re: [A89: displaying varibles]
First, look at rand() in the TIGCC documentation (under *Help* -> index), and
will find rand(void) which means it takes no parameters, probably one of your
errors. Also read about the functions random() and printf_xy(), then try this
program:
#define SAVE_SCREEN
#include <all.h>
short _ti89, _ti92plus;
void _main(void)
{
int min = 12000;
int max = 20000;
int final;
ClrScr();
final = min + random(max - min);
printf_xy(10,10,"%d",final);
ngetchx();
}
-Kurt
"Cullan" <Cullan@calc.org> wrote:
> ---------------------------------------------
> Attachment:
> MIME Type: multipart/alternative
> ---------------------------------------------
i have 2 questions for everyone...
number 1:
i would like to find a random number by subtracting the maximum number from
the minimum, using that differance and finding the random, and then adding the
minimum number to the newly found random number.
i tried this:
max=20000;
min=12000;
b= ( max - min );
num= rand(b);
final= (num+min);
i got errors when i did this though. what am i doing wrong?
Number 2:
i want to display the random number using printf_xy
in the code above how would i go about displaying varible 'final'
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at http://home.netscape.com/webmail