
| · Forums and IRC Rules · Portal |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
| Today's Top 10 Posters · My Last 10 Posts | Board and IRC Rules · Help · Members · Calendar |
| Forum | Topics | Replies | Last Post Info | |
|---|---|---|---|---|
![]() |
Older topics Here you can access all topics posted from May 12th 2005 to Apr 9th 2006 (In read only mode). |
1126 | 15694 | 9 Apr, 2006, 11:06 In: [GAME]Learn how to count to...By: DJ Omnimaga |
![]() ![]() ![]() |
| dinhotheone |
Posted: 29 Jan, 2007, 17:28
|
||
![]() Extreme Poster Group: Members Posts: 378 Member No.: 236 Joined: 11 Nov, 2006 |
i was making a math program for calculus, you basically input an equation for the derivative and the calc will spit out a slope plot (lots of lines aproximating a function with an unknown constant) anyway the problem is that i set the calc to do 2 for loops so it will hit a bunch of points in a square. but for the inside loop's first iterations before it returns back to the outer loop, the loop starts at zero. then later once it goes in again after it hops out, it executes properly. Another odd thing is that the varialbe starts at the correct value up untill it hits an "expr(str1)" then seems to change to zero when it should start at Ymin (Ymin = -3). The only thing that changes the varialbe is the for loop so im confused as to how this could be happening. I've tried having the loop count up and down but no matter what it starts at zero. Ex.
I am 100% sure that the comments are correct because tested it using a pause and then i broke and checked what Y was. So who can tell me whats wrong, and it really is aas simple a code as this, im not leaving anything out between the for's and the ends -------------------- Soccer is life
domination of omnimaga, click below http://img139.imageshack.us/img139/8868/dominationrc5.gif |
||
| trevmeister66 |
Posted: 29 Jan, 2007, 17:30
|
|
Post whore Group: Members Posts: 532 Member No.: 290 Joined: 8 Jan, 2007 |
try using "For(Z..." instead of "For(Y..."
EDIT: i think the "expr(" command deletes the Y variable... I think... -------------------- ~~~~~~~Project Status~~~~~~~
Age of War > .1% < Retransfering Sprites Baseball > 2% < Menu's Learning ASM > 10% < Started first game, and have no idea what I'm doing ![]() (\__/) (='.'=)This is Bunny. Copy and paste bunny into your (")_(")signature to help him gain world domination. |
| dinhotheone |
Posted: 29 Jan, 2007, 17:37
|
![]() Extreme Poster Group: Members Posts: 378 Member No.: 236 Joined: 11 Nov, 2006 |
...WTH why did that work, i changed for y to for z like you said and then at the top of the for i put Z-> Y (because they have to enter the equation with x's and y's) and it worked...cool
about expr( deleting the variable, i would say it seems so but then the rest of the program executed flawlessly... so i dont think so otherwise the for would never make any pprogress. -------------------- Soccer is life
domination of omnimaga, click below http://img139.imageshack.us/img139/8868/dominationrc5.gif |
| Super Speler |
Posted: 29 Jan, 2007, 17:55
|
![]() Post whore Group: Coders Of Tomorrow Posts: 779 Member No.: 95 Joined: 18 Jun, 2006 |
expr( was not what caused the problem, TI-OS uses variables X and Y to preform graphscreen calculations, which is why these variables should be avoided.
-------------------- [color=red]Currently conquering the world. In Phase 1.
List of members of private army:[/color] SilverCalcKnight, TD-Linux, Kuro, Cure, Weregoose, Lolbbq, elfprince13, leofox, Brazucs, +ZERO+, Radical Pi, shadow, bananaman, trigkid213, netham45, Full-Metal-Randomist, myfavcolorchanges, Fallen Ghost, trevmeister66, lolje, Harrierfalcon, clementop, blm22, Mexi1010, baorder54, Bking0, frenchcalc1, TheStorm, jimbauwens, Sting::Ray, IAmACalculator, MechaTech84, Groene07, Angel14995, Xphoenix, lordofthegeeks, tama and... (\__/) (='.'=) (")_(") [color=red]If you wish to join PM me.[/color] [QUOTE=Ad on omnimaga]Ti 83 Game Programming: Move your career forward with an accredited online degree![/QUOTE] [QUOTE=Netham45]It isn't really a problem, but it kind of scares me when people randomly quote me, like they are stalking me.[/QUOTE] |
| dinhotheone |
Posted: 29 Jan, 2007, 18:05
|
![]() Extreme Poster Group: Members Posts: 378 Member No.: 236 Joined: 11 Nov, 2006 |
hmmm...i see, i was trying to make my code easier to be understood because i usually distribute em around the school. But i guess adding a comment in there would do well in a pinch
-------------------- Soccer is life
domination of omnimaga, click below http://img139.imageshack.us/img139/8868/dominationrc5.gif |
| trevmeister66 |
Posted: 29 Jan, 2007, 19:06
|
|
Post whore Group: Members Posts: 532 Member No.: 290 Joined: 8 Jan, 2007 |
well all i know is my idea worked =)
-------------------- ~~~~~~~Project Status~~~~~~~
Age of War > .1% < Retransfering Sprites Baseball > 2% < Menu's Learning ASM > 10% < Started first game, and have no idea what I'm doing ![]() (\__/) (='.'=)This is Bunny. Copy and paste bunny into your (")_(")signature to help him gain world domination. |
| graywolf |
Posted: 29 Jan, 2007, 22:05
|
![]() Extreme Poster Group: Members Posts: 370 Member No.: 230 Joined: 3 Nov, 2006 |
Yah, it sucks that there are no system variables that you can't mess with (like on a TI89). Anwayz, congratz on figuring it out. What does the prgm do anywayz, display secant lines?
|
| xlibman |
Posted: 30 Jan, 2007, 9:22
|
![]() Ragol666 Group: Founder Posts: 11283 Member No.: 1 Joined: 9 Apr, 2006 |
yeah it sucks that this happens. X-Y always go back to 0 when using graph screen, and i got massive trouble figuring out code problems before because of this
-------------------- |
| trevmeister66 |
Posted: 30 Jan, 2007, 9:38
|
|
Post whore Group: Members Posts: 532 Member No.: 290 Joined: 8 Jan, 2007 |
X does too? hmm... <.< i've never had that happen to me, and i use the X var all the time. Maybe i'm just lucky.
-------------------- ~~~~~~~Project Status~~~~~~~
Age of War > .1% < Retransfering Sprites Baseball > 2% < Menu's Learning ASM > 10% < Started first game, and have no idea what I'm doing ![]() (\__/) (='.'=)This is Bunny. Copy and paste bunny into your (")_(")signature to help him gain world domination. |
| Delnar_Ersike |
Posted: 30 Jan, 2007, 11:57
|
![]() Lazy, procrastinating h4xx0r of doom Group: Members Posts: 587 Member No.: 283 Joined: 27 Dec, 2006 |
I never had a chance to find out: I have never used the variables X and Y in my programs before
, but it is a good thing to know -------------------- ![]() Current Projects: -Learning 83+ assembly (10%) -Setting up calc84maniac's on-calc assembler (postponed) -Working on a secret project (5%) Working on... -Learning 83+ assembly: On Day 7 in Learn ASM in 28 Days and still trying to get over my lazy streak -Setting up the on-calc assembler: Decided it is better to code assembly on a computer -Secret project: planning how I will make it, waiting for summer |
| xlibman |
Posted: 30 Jan, 2007, 12:56
|
![]() Ragol666 Group: Founder Posts: 11283 Member No.: 1 Joined: 9 Apr, 2006 |
having this happen with X is rare, but it can happens. I believe its the same for all variables that cannot be archived (ERR:VARIABLE) in the mem menu if you set the calc in Par/Pol/Seq
-------------------- |
| Super Speler |
Posted: 30 Jan, 2007, 15:39
|
![]() Post whore Group: Coders Of Tomorrow Posts: 779 Member No.: 95 Joined: 18 Jun, 2006 |
Yes, that is an almost completely accurate statement.
-------------------- [color=red]Currently conquering the world. In Phase 1.
List of members of private army:[/color] SilverCalcKnight, TD-Linux, Kuro, Cure, Weregoose, Lolbbq, elfprince13, leofox, Brazucs, +ZERO+, Radical Pi, shadow, bananaman, trigkid213, netham45, Full-Metal-Randomist, myfavcolorchanges, Fallen Ghost, trevmeister66, lolje, Harrierfalcon, clementop, blm22, Mexi1010, baorder54, Bking0, frenchcalc1, TheStorm, jimbauwens, Sting::Ray, IAmACalculator, MechaTech84, Groene07, Angel14995, Xphoenix, lordofthegeeks, tama and... (\__/) (='.'=) (")_(") [color=red]If you wish to join PM me.[/color] [QUOTE=Ad on omnimaga]Ti 83 Game Programming: Move your career forward with an accredited online degree![/QUOTE] [QUOTE=Netham45]It isn't really a problem, but it kind of scares me when people randomly quote me, like they are stalking me.[/QUOTE] |
| dinhotheone |
Posted: 30 Jan, 2007, 16:10
|
![]() Extreme Poster Group: Members Posts: 378 Member No.: 236 Joined: 11 Nov, 2006 |
The program graphs a slop field, basically an approximation of the graph of the antiderivative of the function times any constant (i think)
anyway i ran into a different problem, since the user has to enter the function with x's and y's i created 2 loops that check for x's and y's and change them to z and theta and i changed the for loops and the code inside of them. I brought that to school after testing on basic inputs but when i gave it to the only other decent programmer in the school to show it too he entered 100 and 101 for xmin and 200 and 202 for y min, when he does this the calc only shows an empty graph and then exits the program. the only reason i sould see this happening is that somewhere the graph screen variables change so that max is less than min then it doesnt enter the for loop. and then it resets them to what i want them to be. I'd give you my full code if i knew an easier way to post it but basically.... ask for xmin xmax y min and ymax loops around if either max is too big ask for "Resolution of field" not graphscreen res. ® loops around if res is less than 1 or bigger than 2 asks for function decides "res" based on a formula (max-min)/40/R -> N (finance var) does same for y but with I% finance var code thaat switches function x with z and y with theta then stores to str1 for(z,xmin,xmax,N*6) for((theta),ymin,ymax,I%*6 expr(str1 line(z+N,(theta)+I%Ans,Z-N,(Theta)-I%Ans) End End so im not sure why it just exits without looping at all, when i put smaller inputs it works perfectly, when i changed the code to display the text of xmin and xmax right before the loop, they change to 102.2 and 100... im not sure whats the problem. Edit: upon further testing i found that if you enter any positive value for xmin except one, add one to it for xmax, double xmin for ymin and double xmax for ymax, it skipps the loops... Eg. xmin xmax ymin ymax 3 4 6 8 if you enther one then it seems that it doesnt enter the Z for loop, it only draws the lines for the bottom row -------------------- Soccer is life
domination of omnimaga, click below http://img139.imageshack.us/img139/8868/dominationrc5.gif |
![]() |
![]() ![]() ![]() |