Author Topic: Debugging on the Calculator  (Read 13395 times)

0 Members and 1 Guest are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Debugging on the Calculator
« on: April 11, 2010, 01:04:10 am »
So I've been seeing the term "debug" or "debugging" be tossed around here and there and was curious what is meant by it exactlly. I also saw Ztrumpet say that he uses Rcl to help debug too. Can anyone explain this?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Debugging on the Calculator
« Reply #1 on: April 11, 2010, 01:10:07 am »
Debugging is simply fixing problems with your code so that it will work correctly.  Often times in games bugs can be hard to find, so to debug your games, you will both run the game through a couple times, and also try to get into weird scenarios that are not expected, trying to find problems.

As for using Rcl, i dont know what he was using it for o.O

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Debugging on the Calculator
« Reply #2 on: April 11, 2010, 01:12:26 am »
Ah ok. That's what I thought. Now just for Z to answer the part about Rcl :P

Thanks, Builderboy.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Debugging on the Calculator
« Reply #3 on: April 11, 2010, 01:30:40 am »
So I've been seeing the term "debug" or "debugging" be tossed around here and there and was curious what is meant by it exactlly. I also saw Ztrumpet say that he uses Rcl to help debug too. Can anyone explain this?
It's when we want to grab a hammer and smash our calc when trying to get our programs to work.

J/k, what Builderboy said :P

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Debugging on the Calculator
« Reply #4 on: April 11, 2010, 01:32:39 am »
Or it could be like what weregoose does where he just keeps putting together random tokens until he gets the most efficient and speedy solution. ;)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Debugging on the Calculator
« Reply #5 on: April 11, 2010, 01:38:15 am »
Or it could be like what weregoose does where he just keeps putting together random tokens until he gets the most efficient and speedy solution. ;)

Or smallest :P
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

_player1537

  • Guest
Re: Debugging on the Calculator
« Reply #6 on: April 11, 2010, 02:10:06 am »
Basicly, with Rcl you can recall certain numbers into your code.  So say this happens:  You have a program that looks like
Code: [Select]
For(A,1,10)
output(A,A/2,"A")
End
well, when you run this you get a domain error.  So you press 2 to goto the part of your code.  But then you want to look at what number it was that messed your code up, but don't want to go to the homescreen.  So you press [2nd][Rcl] and then A to recall A into your code.  Now you can see exactly what number messed up your code.  Its a pretty useful method imo.  If that doesn't make sense tell me.
« Last Edit: April 11, 2010, 02:22:38 am by _player1537 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Debugging on the Calculator
« Reply #7 on: April 11, 2010, 02:19:50 am »
output(A,A/2) doesN,t that give an ERR:ARGUMENT/SYNTAX error?

Also to check if a If/while/repeat/for loop/condition is not missed, I add + at the beginnign of it so if I get ERR:SYNTAX, it's ran correctly, then I move the + a few lines lower, try again.

Also for missing/too many Ends, what you can do in your head is start with the number 0, then everytime a Then/while/repeat/for is encountered, increment by 1, and when a End is encountered, decrement by 1. If at the end it's higher than 0, an End is missing somewhere. If it's lower, then you have too many.

TI-BASIC has this annoying limitation of not having EndIf, EndRepeat, EndWhile or EndFor instructions. In other languages, it makes code much easier to read.

_player1537

  • Guest
Re: Debugging on the Calculator
« Reply #8 on: April 11, 2010, 02:22:12 am »
woops, yeah I'll fix that.  And I also use that too many/few Ends trick.  Never tried the other one I ussually use a pause instead.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Debugging on the Calculator
« Reply #9 on: April 11, 2010, 02:26:30 am »
That does make a lot of sense, would have been useful to know that a few days ago :P
And thanks for the tips DJ.
« Last Edit: April 11, 2010, 02:27:15 am by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Debugging on the Calculator
« Reply #10 on: April 11, 2010, 02:27:30 am »
iooh ok yeah he fixed it in his post now

I do that often too

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Debugging on the Calculator
« Reply #11 on: April 11, 2010, 11:05:30 am »
Debugging is a magical thing that lets you kill the bugs in your program.

Also, I agree with player.
Recalling the last value is a great technique.
Use it often.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Debugging on the Calculator
« Reply #12 on: April 11, 2010, 12:28:43 pm »
Basicly, with Rcl you can recall certain numbers into your code.  So say this happens:  You have a program that looks like
Code: [Select]
For(A,1,10)
output(A,A/2,"A")
End
well, when you run this you get a domain error.  So you press 2 to goto the part of your code.  But then you want to look at what number it was that messed your code up, but don't want to go to the homescreen.  So you press [2nd][Rcl] and then A to recall A into your code.  Now you can see exactly what number messed up your code.  Its a pretty useful method imo.  If that doesn't make sense tell me.

That actually is pretty easy. Row/column numbers used in output can only be whole numbers, so for the statement For(A,1,10), A will be troublesome every other number. That is not a hammer situation. I can show you a hammer situation.

_player1537

  • Guest
Re: Debugging on the Calculator
« Reply #13 on: April 11, 2010, 12:34:25 pm »
Basicly, with Rcl you can recall certain numbers into your code.  So say this happens:  You have a program that looks like
Code: [Select]
For(A,1,10)
output(A,A/2,"A")
End
well, when you run this you get a domain error.  So you press 2 to goto the part of your code.  But then you want to look at what number it was that messed your code up, but don't want to go to the homescreen.  So you press [2nd][Rcl] and then A to recall A into your code.  Now you can see exactly what number messed up your code.  Its a pretty useful method imo.  If that doesn't make sense tell me.

That actually is pretty easy. Row/column numbers used in output can only be whole numbers, so for the statement For(A,1,10), A will be troublesome every other number. That is not a hammer situation. I can show you a hammer situation.
ok, I was just out of examples, it works really well in whatever code I have that messes up.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Debugging on the Calculator
« Reply #14 on: April 11, 2010, 12:41:49 pm »
I never actually thought of using Rcl. I use Pause mostly when testing loops. For variable-based errors, I usually take hours to figure out where they are. lol. Thanks for the idea.