Author Topic: TI-BASIC Q&A  (Read 66319 times)

0 Members and 1 Guest are viewing this topic.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
TI-BASIC Q&A
« on: November 18, 2011, 05:05:05 pm »
Seeing as how we have an Axe Q&A, I thought it would be nice to have a TI-BASIC Q&A.
Although this probably won't be used as much as the Axe one, I thought it would be a good Idea to have a thread where you can ask questions about TI-BASIC!  ;D
...So, anyone want to start us off with our Q&A?  :)

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: TI-BASIC Q&A
« Reply #1 on: November 18, 2011, 05:26:32 pm »
Yeah, is there anyway to end an if statement like just using end in Axe?

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: TI-BASIC Q&A
« Reply #2 on: November 18, 2011, 05:28:20 pm »
Yeah, is there anyway to end an if statement like just using end in Axe?
Yes. You'll need to use If:Then.
Code: [Select]
If ...condition...
Then
...do stuff...
End


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: TI-BASIC Q&A
« Reply #3 on: November 18, 2011, 05:50:11 pm »
Ok. That was easy. How the heck didn't I know that?!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: TI-BASIC Q&A
« Reply #4 on: November 19, 2011, 08:37:46 pm »
Also, if you only have one line following the If statement, you don't need an End or a Then :)
For example:
Code: [Select]
If A=1
3→D

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: TI-BASIC Q&A
« Reply #5 on: November 19, 2011, 08:43:51 pm »
Is there an easier way to use the GetKey function?
Im kinda tired of WHILE 0...

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: TI-BASIC Q&A
« Reply #6 on: November 19, 2011, 08:44:37 pm »
Is there an easier way to use the GetKey function?
Im kinda tired of WHILE 0...
? could you post some code? I'm not understanding your question... ???

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: TI-BASIC Q&A
« Reply #7 on: November 19, 2011, 08:46:15 pm »
While 0 being the infinite loop statement...
While 0
getkey->A
While A=(KEY PRESS)
getkey->A
End
Im tired of the above implement...

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: TI-BASIC Q&A
« Reply #8 on: November 19, 2011, 08:48:00 pm »
it is possible to just do this:
Code: [Select]
:While 1
:If getKey=(key press)
:do something
:If getKey=(another press)
:do something else
:End

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: TI-BASIC Q&A
« Reply #9 on: November 19, 2011, 08:49:17 pm »
Hmm, thanks!
This will help my ZOMBASIC game!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: TI-BASIC Q&A
« Reply #10 on: November 19, 2011, 09:03:36 pm »
Have you ever used Repeat loops? They are very lovely for these kinds of loops. Repeat will kepp repeating the loop until the condition is true. It does not test the condition before entering the loop (a while loop does). For example, this code will move a pixel around on the screen in a 16x16 area:
Code: [Select]
3→X
3→Y
Repeat A=45     ;Later I will store the key value to A. This means repeat until clear is pressed.
pxl-Test(Y,X→C
9→B
Repeat A          ;getKey will be stored to A, so this repeats until a key is pressed
B+1
If Ans>9
Then
Pxl-Change(Y,X
0
End
Ans→B
getkey→A
End
If A=105     ;Enter
1→C
If A=23       ;Delete
0→C
If A=21       ;2nd
not(C→C
Pxl-Off(Y,X
If C
Pxl-On(Y,X
Y+(A=34)-(A=25
If Ans<0
15
If Ans>15
0
Ans→Y
X+(A=26)-(A=24
If Ans<0
15
If Ans>15
0
Ans→X
End
I may have mistyped something, but that should give you an idea of how to make things work :)
You can press clear to exit, 2nd to invert the pixel, Enter to turn the pixel on, and Del to turn the pixel off.

EDIT: I love Repeat loops :) I actually learned them long before I understood While loops. It think this is more useful...

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: TI-BASIC Q&A
« Reply #11 on: November 19, 2011, 09:06:13 pm »
Well then, Yay I just learned a new command!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: TI-BASIC Q&A
« Reply #12 on: November 19, 2011, 09:10:11 pm »
Hehe, there are lots of cool things you can do in BASIC that you might never even think of O.O I just can't think of any at the moment...

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: TI-BASIC Q&A
« Reply #13 on: November 19, 2011, 09:10:52 pm »
Its just to slow for me so thats why i use axe...

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: TI-BASIC Q&A
« Reply #14 on: November 19, 2011, 09:13:11 pm »
DJ_O used to make some pretty amazing/fast BASIC programs that could rival Axe >:D Although generally it is slower :/ People love the challenge of BASIC >:D