Pages: (2) [1] 2  ( Go to first unread post ) add reply  new poll 

 Undocumented Tips And Tricks, From UTI
Luby
Posted: Jan 28 2008, 01:44 AM


That one kid


Group: Staff
Posts: 130
Member No.: 2,803
Joined: 27-January 08



1. Delvar ADelvar Str1... you don't need to use ":" between the Delvars
2. use Text(-1,row,column,"your text to get big letters in the graph screen
3. If B=0
Then
A+1->A
End
Try:
A+not(B->A

4. you can use Text(-1,0,90," ") to get rid of the run indicator or on the home screen just do Output(1,16," " (TI-83(+?) only)
5. Pause "TEXT HERE (pauses and displays text)
6. Output(1,1," as the last line of a program prevents the Done from being displayed.
7. Str1->Y1 string to equation without using Str>Equ(Str1,Y1
8. How to get a -> in a string:
type -> on the home screen and press enter.
You will get err: Syntax, so select quit.
press y=
Press 2nd recall
Now, use Equ>Str(Y1,Str1)
The -> will be in a string.
9. GetKey->K
-(K=24)+(K=26)->A

The above will return either a -1 or 1 depending if you press left or right.
10. Pause (variable(s) or text) also allows you to scroll sideways.
11. Input by itself makes a crosshair on the graph screen.
12. If you want to find out how many places are in a number, just use this line in your program: int(log(# or variable)+1), but it doesn't count any digits after the decimal.
13. For it to work with decimals you need:
int(log(ipart(# or variable)+fpart(same # or variable))+2
14. Have you ran out of variables to use for your program? Just go to the Finance menu, under the "Apps" button for the 83+, and press the right arrow button so that you are now on the variables menu. You can use just about any of these to store a number to.
15. To display multiple blocks of text (or variables): Text(Y,X,"TEXT","TEXT","TEXT
16. if you press alpha followed by up or down, you will scroll a whole page of program code.
17. 2nd right will take you to the end of your current line, 2nd left will take you to the beginning of that line.
18. If-then-command(s)-end statements take up a bit more space than If-command statements, but are significantly faster (about 2x). debunked by DarkerLine
19. The smallest and (almost) fastest way to shuffle a deck of cards is
:seq(X,X,1,52->L1
:rand(52->L2
:SortA(L2,L1

20. If you want the flexibility of calling subroutines but don't want to bundle a bunch of subprograms with your main program, use internal subroutines. At the beginning of your program put something like
:If Q=2.351 // or any random number
:Then
:0->Q // prevents the program from messing up if the user breaks during execution
:Return
:End

... and when you want to call the subroutine:
:2.351->Q
:pgrmGAME

You can even have multiple subroutines by using different numbers for Q.
21. Unlike Gotos, the If-then statement in the subroutine is automatically terminated when it hits return, so you won't get any memory errors. It's also a lot faster than Goto, especially in large programs.
22. You can use internal subs too; almost.

While 1
;do something
Goto A ;A is the sub
End
Lbl A
;do sub stuff
End
;returns to the top of the while loop not exactly where we left off, but to the top of the main sub providing the While condition is still true which it will be because we used While 1.
23. another way to make subroutines is to call a prgm e. g. (theta)subrout and store into A the number of the subrout you want to execute.
it would look like this:

:if A=1
:then
\
\ subroutine
\
:return
:if A=2
:then
...

this method has the advantage that you don’t need a bunch of labels in your prgm and you can use the subroutines in different prgms
24. If your window is like this:
Xmin=-47
Xmax=47
Ymin=-31
Ymax=31

You can use grid on to make the entire screen black. Note: it is slow
25. (B+C)/D can be optimized to D-1(B+C
26. ClrDraw deletes the variables X and Y, and clears the graph screen of any pixels
27. [/b]If A=1 and (B=0 or B=10)[/b] can be If (A=1)not(B(B-10
28. when storing to a custom list, you don’t need the L!
{1,2->A
is the same as
{1,2->LA
29. :For(N,1,28
:Text(1,N,Sub("[[-[[ [[ýý) [[.. [[.. ([)[( ",N,1 //ý is y with a - above it
:End


In this example it displays HELLO in a bolder font. (text sprites)
30. Pxl-Test(0,0:If Ans is faster then if pxl-Test(0,0
31. you can use
:For(A,16,0
:End

If you want to store something in A without messing up Ans
32. Use the little E (for scientific notation) to write powers of 10. You don't need a 1 before the E (E2 = 1E2 = 1 X 10^2 = 100) Use E2 for 100, E3 for 1000, etc.
33. the quickest way to check if all the elements of L1 are the same is max(Δlist(L1
34. not(fpart(x is the fastest way to check for a whole number
35. abs(a+bi Where a and b are legs of a right triangle and i is the imaginary i , gives the hypotenuse.
36. Pt-on(x,y, 2 (or 3)) the 2 gives you a 3 by 3 square the 2 gives a 3 * 3 plus sign
37. I'm sure others like me want to be able to type in a list without the brackets, separating the elements with only commas. Here's how: Input Str1
expr("{"+Str1->L1

38. 5197/12953427:Ans-1►Frac then returns 12953427/5197.
39. Repeat 5>=length(Str1
:Input "Name of List ",Str1
:End
:expr("/L/"+Str#/->/L/1/

will load any list the user names
40. A or B or C or D or E is the same as max({A,B,C,D,E}) so you can make if x = 1 or x= 2 or x =3 into if max(X={1,2,3
41. A and B and C and D and E is the same as prod({A,B,C,D,E})
42. :ClrDraw
:-10->Xmin
:-10->Ymin
:10->Xmax

can be optimized to Zstandard
43. Those u v and w (2nd 7,8,9) can be used like
1->X
"2X->u
u ;gives 2
2->X
u ;gives 4

44. Using a program editor you can place the % symbol directly into the code as a replacement for multiplying by .01 to save a few bytes.
45. CumSum(binomcdf(X,0 is the same as seq(I,I,1,X but it’s smaller and faster
46. 0→Xmin:1→ΔX
0→Ymin:1→ΔY

Can be optimized by using
ZStandard
84→Xmin
52→Ymin
ZInteger
or
ZDecimal
90→Xmin
58→Ymin
ZInteger
or
ZTrig
88→Xmin
58→Ymin
ZInteger

47. to separate a list into two or more list you can use
seq(L1(A),A,1,10->L2
Where L1 is the starting list 1 is the starting point and 10 is the end and L2 is the resulting list.
48. Fast Circle: Circle(0,0,5,{i
49. Put “ on the text screen :you can do Text(Y,X,'' (two appostraphes) ' is found by pressing 2nd + Apps and then it's the second one down.
50. sub(n == .01n
51. X+△list(K={24,26 ->X is 2 bytes smaller then X+(K=26)-(K=24 -> X. (used in detecting keypresses), but is ~3.5 times slower. Good for use in a menu.
Top
tifreak8x
Posted: Jan 28 2008, 04:36 AM


photoninator


Group: Admin
Posts: 3,253
Member No.: 1
Joined: 11-August 04



Great work luby. ^^

Hopefully others find this list useful smile.gif
Top
darkstone knight
Posted: Mar 15 2008, 01:54 PM


Member


Group: Members
Posts: 33
Member No.: 2,723
Joined: 20-January 08



nice work

btw,what is the fastest geykey thingey for a snake game

:getkey
:if max(ans={24,25,26,34
:ans->k

of

:getkey
:if not(min(ans-{24,25,26,34
:ans->k

?
Top
super speler
Posted: Mar 15 2008, 02:01 PM


Bot Banninator


Group: Staff
Posts: 250
Member No.: 108
Joined: 23-June 06



The first one of those is faster however this may be even better:

:getKey
:If Ans=34 or 2>Abs(25-Ans
:Ans->K
Top
darkstone knight
Posted: Mar 15 2008, 05:00 PM


Member


Group: Members
Posts: 33
Member No.: 2,723
Joined: 20-January 08



you are correct, it runs about 10% faster
Top
Bronco
Posted: Mar 15 2008, 05:33 PM


[insert title]


Group: Programmers
Posts: 534
Member No.: 202
Joined: 18-November 06



QUOTE
25. (B+C)/D can be optimized to D-1(B+C


You should make a note that the -1 is supposed to be superscripted as a power. So, if you were going to put this in your calculator, when you reach the -1 part, instead of inputing D (minus) 1 (which won't work by the way) or D (to the negative one power), you would press the X-1 button (the one right underneath the MATH button). Just thought I would point that out so that new programmers don't get confused smile.gif

Good list by the way wink.gif

EDIT: Actually, I think that (B+C)/D is faster than D-1(B+C even though it is one byte more.
Top
bfr
Posted: Mar 16 2008, 01:03 AM


Advanced Member


Group: Members
Posts: 177
Member No.: 75
Joined: 13-April 06



After briefly looking over the list, these are very useful. Nice work! happy.gif

I'm surprised about:

QUOTE

30. Pxl-Test(0,0:If Ans is faster then if pxl-Test(0,0
Top
Luby
Posted: Mar 19 2008, 12:09 PM


That one kid


Group: Staff
Posts: 130
Member No.: 2,803
Joined: 27-January 08



25. (B+C)/D can be optimized to D-1(B+C

You should make a note that the -1 is supposed to be superscripted as a power.


EDIT: Actually, I think that (B+C)/D is faster than D-1(B+C even though it is one byte more.
Quoted from bronco


Fixed.

I tested the code and the D-1(B+C is faster.
Top
Luby
Posted: Jun 10 2008, 01:01 AM


That one kid


Group: Staff
Posts: 130
Member No.: 2,803
Joined: 27-January 08



50. sub(n == .01n

Thank you Weregoose. It still has me scratching my head.
Top
darkstone knight
Posted: Jun 16 2008, 02:36 PM


Member


Group: Members
Posts: 33
Member No.: 2,723
Joined: 20-January 08



:x+△list(K={24,26 ->
15 bytes

:x+(K=26)-(K=24 -> X
17 bytes


(Ymax=.062)
:Ø+(k=26)-(k=24)+E-3((K=25)-(K=34 -> Ø
36 bytes (actualy 18) and fast

worship.gif
yes, found this out myself
Top
Luby
Posted: Jun 16 2008, 03:37 PM


That one kid


Group: Staff
Posts: 130
Member No.: 2,803
Joined: 27-January 08



QUOTE (darkstone knight @ Jun 16 2008, 09:36 AM)
(Ymax=.062)
:Ø+(k=26)-(k=24)+E-3((K=25)-(K=34 ->Ø

36 bytes (actualy 18) and fast

Okay.
What is this optimized from? And, is that null sign supposed to be theta?



X+(delta)list(K={24,26 -> X
15 bytes
is documented.


Note: darkstone knight can post deltas, but I can't.
Top
darkstone knight
Posted: Jun 16 2008, 04:51 PM


Member


Group: Members
Posts: 33
Member No.: 2,723
Joined: 20-January 08



QUOTE (Luby @ Jun 16 2008, 03:37 PM)
Okay. 
What is this optimized from?  And, is that null sign supposed to be theta?



X+(delta)list(K={24,26 -> X
15 bytes
is documented.


Note:  darkstone knight can post deltas, but I can't.

whit the wii you can post all sorts of υφχψωΑΓΔΕΘΞΛΡΠΣΩ□△◎◇○☆φζβγαŸδξτ symbols

the Ø is tetha.., yes
you can split the y var by using fpart(

whit correct use its 23% faster(cuz of ans)

edit: its .03% or someting
the command timing dude messed up wacko.gif
Top
Luby
Posted: Jun 29 2008, 03:43 AM


That one kid


Group: Staff
Posts: 130
Member No.: 2,803
Joined: 27-January 08



I'm still not seeing what you are trying to tell me on that second optimization. Please give an example of what would be the bigger, slower way, and your new way and what it can be used for.
Top
Steelersfan1693
Posted: Oct 13 2009, 02:06 PM


Newbie


Group: Members
Posts: 5
Member No.: 7,433
Joined: 13-October 09



THANK YOU!
Top
Steelersfan1693
Posted: Oct 13 2009, 02:17 PM


Newbie


Group: Members
Posts: 5
Member No.: 7,433
Joined: 13-October 09



What is multiplicity??
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | 1337 programming tips | Next Newest »


Topic OptionsPages: (2) [1] 2  add reply  new poll 




Hosted for free by InvisionFree (Terms of Use: Updated 7/7/05) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 0.0184 seconds | Archive
TI-Freakware's TI Ring
TI-Freakware's TI Ring
[ Join Now | Ring Hub | Random | << Prev | Next >> ]