[TIB] Re: data type issue


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

[TIB] Re: data type issue




Hmm.. easiest way I can think of would be to put an if statement in the 
program where if the current iteration is some multiple of 10, it prints 
the current results and starts on the next 10 without breaking the 
increment setup.. I can't seem to find a remainder function on the ti-86 
though. I know it's got to have one.. can someone clue me in? Thanks



On Mon, 3 Feb 2003, Tib wrote:

> 
> Yes! That did it, as in-elegant as it may seem, the sub() function did the 
> trick. Thankyou :]
> 
> Checking success is easy enough, inside the for loop place an if statement 
> that tests if the rolled number is >= the value needed to succeed and 
> increment a variable that gets displayed at the end.
> 
> Hmm.. next problem - it seems that I can only get 10 results per line 
> (single digit with space inbetween) per line.. now I just need to break it 
> up so I can actually see them all instead of just getting a ... and then a 
> # of successes.
> 
> 
> 
> 
> On Mon, 3 Feb 2003, CJ Wallace wrote:
> 
> > Well, you could always just save every roll to a list, and just display 
> > the list - the OS formats the output for you. Simply:
> > 
> > :A->L1(B)
> > 
> > Where A is the number that was rolled, L1 is the list, and B is the 
> > list's index. This would be the option to choose to accomlplish your 
> > 'sucess checking.' Comparisons on a list are done like so:
> > 
> > :A>L1(B)
> > :A=L1(B)
> > etc.
> > 
> > I think you can take it from there.
> > 
> > But if you must have string output, it can be done. There really isn't a 
> > simple way to enter numerical data into a string from a variable though. 
> > Try this code [note, I'm using TI-83 tokens]:
> > 
> > :Str1+sub("123456",A,1)->Str1
> > 
> > Where A is your roll and Str1 is your string. Formatting the string is 
> > an exercise left up to the reader.
> > 
> > -c.j.w.
> > 




Follow-Ups: References: