Author Topic: TI 83+/84+ randomness  (Read 19105 times)

0 Members and 1 Guest are viewing this topic.

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #90 on: February 03, 2011, 07:12:40 pm »
Some more optimizations:

2*A can be 2A (in the gambling part, right after the first "You Won" message)
Similarly for the other cases (3*A can be 3A, 4*C can be 4C, etc.)

After the line

Code: [Select]
Output(8,1,"< MODE IS QUIT >there is B+(K+26 and ... 0
The ending parenthesis can be omitted.

Before the message, "BETA TESTER!", the If statement

If LRNDM(1)=1

can be:

If LRNDM(1

The same applies to all similar cases.

Right after Lbl 3, 0 -> B can be DelVar B.

A little after the "All codes unlocked" message,

Repeat LRND(F+1)=0

can be

Repeat not(LRND(F+1

In general, closing parentheses and multiplication symbols should be omitted.
Also, if there is a conditional (If, While, etc.) that requires an expression equal to 1, the =1 part can be omitted. So,

If L=1

would become

If L
« Last Edit: February 03, 2011, 07:42:05 pm by program4 »

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: TI 83+/84+ randomness
« Reply #91 on: February 03, 2011, 07:36:01 pm »
Although this isn't a speed-intensive game, isn't it true that 0-> is actually faster (although Delvar is smaller? (but only due to the fact that you can chain commands off of it))?
« Last Edit: February 03, 2011, 07:36:12 pm by squidgetx »

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #92 on: February 03, 2011, 07:50:36 pm »
It probably doesn't make too much of a speed difference, since TI-Basic Developer suggests always using DelVar:

http://tibasicdev.wikidot.com/optimize-deleting
« Last Edit: February 03, 2011, 07:50:51 pm by program4 »

Offline ferox

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +3/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #93 on: February 04, 2011, 02:22:01 am »
Also, if you want an optimisation trick, you can leave off the ending quote. Also, Disp commands can be on the same line. So:
Code: [Select]
Disp "HELLO"can be optimised to:
Code: [Select]
Disp "HELLO
i did know this one, but i may have done it sometimes...

And this:
Code: [Select]
Disp "HELLO"
Disp "WHAT IS"
Disp "YOUR NAME?"
Can be:
Code: [Select]
Disp "HELLO","WHAT IS","YOUR NAME?
i think, that far in the back of my mind i knew it, but i forgot, it seems.

Some more optimizations:

2*A can be 2A (in the gambling part, right after the first "You Won" message)
Similarly for the other cases (3*A can be 3A, 4*C can be 4C, etc.)

After the line

Code: [Select]
Output(8,1,"< MODE IS QUIT >there is B+(K+26 and ... 0
The ending parenthesis can be omitted.

Before the message, "BETA TESTER!", the If statement

If LRNDM(1)=1

can be:

If LRNDM(1

The same applies to all similar cases.

i just did that to be sure it worked ;)

Right after Lbl 3, 0 -> B can be DelVar B.

A little after the "All codes unlocked" message,

Repeat LRND(F+1)=0

can be

Repeat not(LRND(F+1
i have never used the not( statement before, i'll experiment with it ;)

In general, closing parentheses and multiplication symbols should be omitted.
Also, if there is a conditional (If, While, etc.) that requires an expression equal to 1, the =1 part can be omitted. So,

If L=1

would become

If L

now your saying it wrong.
If L/=0
(does not equal)

would become

If L

because "If L" returns 1 if the variable exists


i'll wlak through my prog today and see what i can do with your tips :D
on hold:

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #94 on: February 04, 2011, 07:30:06 pm »
In general, closing parentheses and multiplication symbols should be omitted.
Also, if there is a conditional (If, While, etc.) that requires an expression equal to 1, the =1 part can be omitted. So,

If L=1

would become

If L

now your saying it wrong.
If L/=0
(does not equal)

would become

If L

because "If L" returns 1 if the variable exists


i'll wlak through my prog today and see what i can do with your tips :D

Well L=1 is basically a subset of L /=0 (a special case), but you're right.

If the only possible values of L are 1 or 0, then you can use If L instead of If L=1. However, if L can be 0, 1, or 2, you would have to use

If L=0
(code)
If L=1
(code)
If L=2
(code)

Offline ferox

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +3/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #95 on: February 05, 2011, 03:24:50 am »
In general, closing parentheses and multiplication symbols should be omitted.
Also, if there is a conditional (If, While, etc.) that requires an expression equal to 1, the =1 part can be omitted. So,

If L=1

would become

If L

now your saying it wrong.
If L/=0
(does not equal)

would become

If L

because "If L" returns 1 if the variable exists


i'll wlak through my prog today and see what i can do with your tips :D

Well L=1 is basically a subset of L /=0 (a special case), but you're right.

If the only possible values of L are 1 or 0, then you can use If L instead of If L=1. However, if L can be 0, 1, or 2, you would have to use

If L=0
(code)
If L=1
(code)
If L=2
(code)

okay :D

i optimized it during school, but at the end of the day i used ARCHUNDEL and by accident i replaced the optimized version with the non-optimized...
« Last Edit: February 05, 2011, 03:25:48 am by ferox »
on hold:

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #96 on: February 06, 2011, 05:53:25 pm »
Oh... sorry to hear  :(

It's good to get in the habit of backing up often, even if that means making a group on the calculator.

For optimizations, you can always go to the TI-Basic Developer: http://tibasicdev.wikidot.com/home

There is a lot of information there that I sometimes use.  :D

Offline ferox

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +3/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #97 on: February 07, 2011, 01:42:37 am »
well, i have another full day ahead, so i will see what i can do.

btw pity L1(1=X  doesn't work

and i have ran out of ideas to add :(
on hold:

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: TI 83+/84+ randomness
« Reply #98 on: February 07, 2011, 08:39:07 am »
btw pity L1(1=X  doesn't work
Try X=L1(1 instead, maybe?

Offline ferox

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +3/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #99 on: February 07, 2011, 10:54:36 am »
btw pity L1(1=X  doesn't work
Try X=L1(1 instead, maybe?
WHAHAHA XD i hadnĀ“t thought of that XD i feel so stupid right now...
lolz, thx XD

im just used to that. first the var, then the thing that it needs to equal,etc...
« Last Edit: February 07, 2011, 10:55:32 am by ferox »
on hold:

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: TI 83+/84+ randomness
« Reply #100 on: February 07, 2011, 10:57:23 am »
L1(1)=X can also be used, but it's one byte larger.

Offline ferox

  • LV3 Member (Next: 100)
  • ***
  • Posts: 94
  • Rating: +3/-0
    • View Profile
Re: TI 83+/84+ randomness
« Reply #101 on: February 07, 2011, 10:58:01 am »
L1(1)=X can also be used, but it's one byte larger.

i know, i used it all the time ;)
on hold: