View Full Version: New Tricks For Pure Basic Coders.

Omnimaga: The Coders of Tomorrow > Calculator help and support > New Tricks For Pure Basic Coders.

Pages: [1] 2

Title: New Tricks For Pure Basic Coders.


Super Speler - November 17, 2006 02:08 AM (GMT)
Everything here uses ZoomStandard.

Lately I have done alot of experementing with using Y functions for full screen graphics. I found that you can actually make very fast and fairly memory efficiant graphics using nothing but Y commands (Y1, Y2 etc). Here is a list of several things that can be done:

Brick Wall:
First set to mode Simul and store 8 to xRes, now store -10(X-20 to Y1 -10 to Y2 and -10 to Y3. Select the graph style that looks like an upside down staircase. Hit graph. You have a Brick Wall. This can be used in program.

Grayscale Bug
This can be used in a program but I can't see any real way to... anywho: use all the same settings as for the brick wall (including the upside down staircase's) except graph different things. -10(X-20)/(X<8 to Y1 and -10(X<8 to Y2.

xlibman - November 17, 2006 03:10 AM (GMT)
interesting find :)

Super Speler - November 17, 2006 03:10 AM (GMT)
Thanks.

Halifax - November 17, 2006 08:38 PM (GMT)
Woah that's pretty sweet and awesome find. These are the kind of advances we need

For the brick wall you could set those -10's to 0's so that half the screen is bricks and that is like a background to a room or something

Another thing is yes I noticed this grayscale bug before and it is like wierd cause if you put that stuff you said for grayscale into the graphing screen and graph it then you'll notice on the last line of vertical pixels that it will be flickerless grayscale which is very wierd

Radical Pi - November 17, 2006 09:10 PM (GMT)
Great job documenting these!
The 'grayscale bug' I have noticed, but only when trying to get different shades of blue with the fast contrast setting (it works there too. Try setting the left half of the graphscreen all black, right half clear, and run the bluescale loop. You get Perfect gray and blue!)

dinhotheone - December 10, 2006 06:01 PM (GMT)
that is so sweet, im going to have to look up simulate mode in the manual to figure out how it works tho

bfr - December 10, 2006 10:20 PM (GMT)
dinhotheone: Simulate mode? Of of the top of me head, I'm not completely sure, but I think that it's simultaneaus (sp?) mode, meaning that it graphcs equations simultaneausly, or at the same time.

Super_Speler: Nice work! :thumbup:

elfprince13 - December 11, 2006 01:32 AM (GMT)
psuedo local variables for recursion:
keep a list with the variable name you want, and an index variable measuring your recursion depth. every time you enter a routine that needs the local variable increase the index variable and push onto the variable list with augment{(L)VARNM,{VAL}). every time you exit, decrease the index variable and pop off the variable list with indexvar->dim((L)VARNM

you can access the local variable with (L)VARNM(indexvar)

dinhotheone - December 17, 2006 02:51 AM (GMT)
Ya i didn't really put the correct ending to the abreviation. I understand now.
plus i can't feel to bad since it was an extreme programmer that corrected me. not just one of the regular ones.

Halifax - December 17, 2006 11:24 AM (GMT)
This is always something that has annoyed me and I figured I should say it. Shouldnt TI call it concurrently cause it doesn't do it simultaneously. It searches ever vertical row for if a pixel should be on

xlibman - December 17, 2006 06:17 PM (GMT)
moved to calc help and support and pinned

Netham45 - August 10, 2007 11:24 PM (GMT)
I found this earlier:
CODE

for(a,0,1000)
If G=1
Then
getkey
end
end

too roughly 10 seconds longer than this:
CODE

for(a,0,1000)
1->g
while g=1
getkey
0->g
end
end

TheStorm - August 11, 2007 02:12 PM (GMT)
So While is faster than if then That is an awesome find.

Super Speler - August 11, 2007 02:36 PM (GMT)
Did you use StartTmr, a timer, or your own counting for the tests?

dinhotheone - August 11, 2007 02:59 PM (GMT)
wow, thats pretty nasty, the only annoying part is that it might be a pain to break outa that while. i guess you could just do while condition and g, and then change g for it to work like a true if then

TheStorm - August 11, 2007 04:09 PM (GMT)
I wonder if it is th same for repeat?

Super Speler - August 11, 2007 04:20 PM (GMT)
Well, Repeat works differently (it always completes the loop at least once).

DJ Omnimaga - August 11, 2007 10:07 PM (GMT)
what is StartTmr?

Super Speler - August 11, 2007 10:58 PM (GMT)
It is a command built into 84+'s and 84+ SE's which tells you in interger form what time it is. It is used like this:

:StartTmr->T
...Test Code...
:CheckTmr(T

DJ Omnimaga - August 11, 2007 11:45 PM (GMT)
ah ok i see

Halifax - October 12, 2007 08:15 PM (GMT)
*bump*

I don't know if this has been said before in another topic but...

CODE

100->X
1000->X
2000->X


optimizes to

CODE

E2->X
E3->X
2E3->X


Just a play scientific notation. It works just as fast, if not faster than the former.

I don't know about math operations on scientific notation numbers, but I would expect it to be the same. Either way this is a great way to save bytes.

Super Speler - October 12, 2007 08:33 PM (GMT)
Actually, 10^( is generally a faster way to do the same (or rather, a very similar) thing.

Halifax - October 12, 2007 08:40 PM (GMT)
Really? It has been tested?

Super Speler - October 12, 2007 08:43 PM (GMT)
Yup, it's in basic code timing thingy... I mean 10^( as one token by the way.

Halifax - October 12, 2007 09:00 PM (GMT)
Yeah, I understand, cool. I didn't know that. :)

DJ Omnimaga - October 12, 2007 11:33 PM (GMT)
i didn't knew E can be used without a number as prefix o.o

TheStorm - October 13, 2007 02:59 AM (GMT)
Yep it is very helpful that way

kalan_vod - November 8, 2007 02:41 AM (GMT)
Well I just saw burr post about the graphing vars, and it is very useful!
CODE
:"randInt(X,Y->u;2nd 7 or 8 (u or v)

Now execute u/v and it works as an instruction ;)

DJ Omnimaga - November 8, 2007 02:44 AM (GMT)
example, screenshot? o.o

kalan_vod - November 8, 2007 02:51 AM (GMT)
QUOTE (burr)
You don't need to store C to a variable; Ans can be used instead.
CODE
:For(A,1,26+8D
:Repeat [I](B,Ans
:randInt(1,9→B
:randInt(1,9
:End
:0→[I](B,Ans
:End

However, if you use the randInt(1,9 statement elsewhere in your program, you can store it to one of the graphing variables (such as u or v) and then use that instead.
CODE
:"randInt(1,9→u
:For(A,1,26+8D
:Repeat [I](B,Ans
:u→B:u
:End
:0→[I](B,Ans
:End

nitacku - November 8, 2007 02:54 AM (GMT)
Holy crap! This could make many things so much easier.
Especially things where you want to save memory.

Super Speler - November 8, 2007 08:21 PM (GMT)
It's somewhat slower but that can be useful.

kalan_vod - November 8, 2007 08:34 PM (GMT)
CODE
:DelVar X"X+(Ans=26)-(Ans=24->u
:While 1
:Output(1,1,X
:getkey
:u:Ans->X
:End

Could be used in menus, since it is slower (saving some bytes when needed).

angel14995 - November 8, 2007 09:32 PM (GMT)
And what's even better is you can save the value of u or v into a normal variable (just checked). Its really useful I can see for using the same formula over and over... hehehe, no need for prgmθTDH anymore, u -> H will got fine, and smaller :)

Super Speler - November 8, 2007 09:38 PM (GMT)
I suppose I should mention that you can do a similar thing with lists. Try this:

:"randInt(1,3,2->LA
:Disp LA

kalan_vod - November 9, 2007 12:29 AM (GMT)
This could be really useful with xlib ;)..

Halifax - November 17, 2007 03:27 AM (GMT)
QUOTE (Super Speler @ 12 Oct, 2007, 15:33)
Actually, 10^( is generally a faster way to do the same (or rather, a very similar) thing.

I actually just tested this today. 10^( takes 6 seconds while E only takes 4 seconds.

(1000 iterations were done by storing 1000 to variable B.)

CODE

For(A,1,1000
E3->B
End


CODE

For(A,1,1000
10^(3->B
End


And they both take the same number of bytes, so I would go with E since it is faster.

Super Speler - November 17, 2007 03:56 AM (GMT)
Really? Did you use StartTmr? Did you use the 10^( token or write that out?

Halifax - November 17, 2007 04:29 AM (GMT)
I used the token. And I ran the programs, respectively, 20 times to make sure that it wasn't just a fluke.

Also, I use getTmr->L1 and getTmr->L2 and then subtract the start time from the end time.

Xphoenix - November 17, 2007 06:12 AM (GMT)
Is getTmr some command I've never heard of?




* Hosted for free by InvisionFree