* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: My BASIC Questions  (Read 1374 times)

0 Members and 1 Guest are viewing this topic.

Offline xMarminq_

  • Full User
  • Join Date: Sep 2016
  • Location: Generic Location
  • Posts: 446
  • Post Rating Ratio: +3/-0
  • Generic Personal Text
    • @UCUWQR30oIW2fRqCNI2IDGIA
  • Gender: Male
My BASIC Questions
« on: November 13, 2016, 11:24:38 pm »
I am making a part of a game where I need two things running at once, like doing an action in a said time period.
Let me know what you would do, and will certainly help in the development. 


  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Offline E37

  • Full User
  • Join Date: Jul 2016
  • Location: Lihilzard Empire
  • Posts: 229
  • Post Rating Ratio: +10/-0
  • I own 2 game consoles, a ti-83 and a ti-84!
    • E37
Re: My BASIC Questions
« Reply #1 on: November 13, 2016, 11:38:23 pm »
I would have them take turns running. Knowing what two things would be helpful.
To answer your question, there is no way of doing two things at the exact same time at all on the calc.
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

Offline p2

  • CodeWalrus Staff
  • Super User
  • Moderator
  • CodeWalrus Supporter
  • *
  • Join Date: Aug 2016
  • Location: Germany
  • Posts: 2283
  • Post Rating Ratio: +8/-0
  • *Wubba lubba dub dub*
    • KaliPhobos
  • Gender: Male
Re: My BASIC Questions
« Reply #2 on: November 13, 2016, 11:56:08 pm »
in general you can either switch between two tasks super fast or do two things after another and repeat that over and over again...
which would be Interrupts (not available in pure BASIC) or putting everything in your main loop ^^
Code: [Select]
While 1
: task 1
: task 2
: task 3
:End
btw WHILE 1 is the same as WHILE TRUE which means the condition (true) is always met ---> infinite loop :)

But before trying something fancy now, listen to E37 as there are better ways of doing many things ^^
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Offline kotu

  • -< \'V/,,,
  • Super User
  • Join Date: Aug 2016
  • Location: don't panic
  • Posts: 1160
  • Post Rating Ratio: +7/-11
  • woah
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @romanov-psyco
    • futurerave.uk
  • Gender: Male
Re: My BASIC Questions
« Reply #3 on: November 13, 2016, 11:59:27 pm »
We really need a bit more information as.... you may have a simpler situation than described above

For example if you need to work out distance travelled for two cars, you can just multiply 'Time Passed' by Speed and there you have both distances
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

Offline xMarminq_

  • Full User
  • Join Date: Sep 2016
  • Location: Generic Location
  • Posts: 446
  • Post Rating Ratio: +3/-0
  • Generic Personal Text
    • @UCUWQR30oIW2fRqCNI2IDGIA
  • Gender: Male
Re: My BASIC Questions
« Reply #4 on: November 14, 2016, 01:36:13 am »
Like I want someone to tap a button to get to a certain value while a timer is going off
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Offline kotu

  • -< \'V/,,,
  • Super User
  • Join Date: Aug 2016
  • Location: don't panic
  • Posts: 1160
  • Post Rating Ratio: +7/-11
  • woah
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @romanov-psyco
    • futurerave.uk
  • Gender: Male
Re: My BASIC Questions
« Reply #5 on: November 14, 2016, 01:42:16 am »
What you want to do is fairly simple - someone else will explain though as I don't know really any TI-BASIC
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

Offline xMarminq_

  • Full User
  • Join Date: Sep 2016
  • Location: Generic Location
  • Posts: 446
  • Post Rating Ratio: +3/-0
  • Generic Personal Text
    • @UCUWQR30oIW2fRqCNI2IDGIA
  • Gender: Male
Re: My BASIC Questions
« Reply #6 on: November 14, 2016, 02:08:59 am »
Start mentioning people you may know who could help
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Offline kotu

  • -< \'V/,,,
  • Super User
  • Join Date: Aug 2016
  • Location: don't panic
  • Posts: 1160
  • Post Rating Ratio: +7/-11
  • woah
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @romanov-psyco
    • futurerave.uk
  • Gender: Male
Re: My BASIC Questions
« Reply #7 on: November 14, 2016, 02:12:54 am »
I don't know who uses TI-BASIC on here, I'm more into other languages, namely C and C++

What you want though is an infinite loop, in which you keep checking for key presses, and keep checking the timer  :P
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

Offline xMarminq_

  • Full User
  • Join Date: Sep 2016
  • Location: Generic Location
  • Posts: 446
  • Post Rating Ratio: +3/-0
  • Generic Personal Text
    • @UCUWQR30oIW2fRqCNI2IDGIA
  • Gender: Male
Re: My BASIC Questions
« Reply #8 on: November 14, 2016, 03:17:21 am »
Any way someone can create something like that here?
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Offline kotu

  • -< \'V/,,,
  • Super User
  • Join Date: Aug 2016
  • Location: don't panic
  • Posts: 1160
  • Post Rating Ratio: +7/-11
  • woah
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @romanov-psyco
    • futurerave.uk
  • Gender: Male
Re: My BASIC Questions
« Reply #9 on: November 14, 2016, 03:25:11 am »
Someone else can help you, not me.
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

Offline kotu

  • -< \'V/,,,
  • Super User
  • Join Date: Aug 2016
  • Location: don't panic
  • Posts: 1160
  • Post Rating Ratio: +7/-11
  • woah
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @romanov-psyco
    • futurerave.uk
  • Gender: Male
Re: My BASIC Questions
« Reply #10 on: November 14, 2016, 03:29:24 am »
Can someone help _xmarminq with some getkey() function equivalent and some timer function for TI-BASIC. Thanks  (-_(//));

*Edit*
@xMarminq_ check out these 2 webpages...

http://tibasicdev.wikidot.com/getkey

http://tibasicdev.wikidot.com/timers

ps. sorry for top-posting  :'(
« Last Edit: November 14, 2016, 03:38:22 am by kotu »
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 750
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: My BASIC Questions
« Reply #11 on: November 14, 2016, 03:46:30 am »
@xMarminq_ , I could help. I'm not sure you're being specific enough, but it sounds like a Cookie Clicker-type thing.

You will have to be more specific, though. What project are you working on? Can you describe what it's supposed to look like? Do you have a TI-83+, TI-84+, or the TI-84+ color models? (as far as timers, there are differences between different models)

Offline xMarminq_

  • Full User
  • Join Date: Sep 2016
  • Location: Generic Location
  • Posts: 446
  • Post Rating Ratio: +3/-0
  • Generic Personal Text
    • @UCUWQR30oIW2fRqCNI2IDGIA
  • Gender: Male
Re: My BASIC Questions
« Reply #12 on: November 14, 2016, 09:21:42 pm »
It is a CE, (5.2 OS) and I want something around a game where you press a button as much as you can to get to certain value in an amount of time (maybe when a key pressed add symbol +, when time expires delete last +, constant decrease of +1 every second) and the If A=7 (Goal) , do this, If A≥7, Menu for restart, if A≤7, action as if goal. (IS this possible? let me know.
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 750
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: My BASIC Questions
« Reply #13 on: November 14, 2016, 11:15:13 pm »
It is a CE, (5.2 OS) and I want something around a game where you press a button as much as you can to get to certain value in an amount of time (maybe when a key pressed add symbol +, when time expires delete last +, constant decrease of +1 every second) and the If A=7 (Goal) , do this, If A≥7, Menu for restart, if A≤7, action as if goal. (IS this possible? let me know.

(IS this possible? let me know.
TI-BASIC is Turing-complete; basically, anything's possible ;) .

So, what you might be looking for here is a Repeat loop and getKey. Repeat has this syntax:
Code: [Select]
Repeat <conditional>
<code>
End
Where <conditional> is the conditional that will end the loop when it is true, and <code> is the code to repeat.
Repeat always runs unconditionally once, then at the end of the loop, it checks the conditional, and exits if it's true, and otherwise it restarts.

getKey is a number that depends on the row and column of the current key pressed (for example, Y= is 11 because it's in row 1 column 1, PRGM is 43 because it's in row 4 column 3, etc). There are only two "exceptions"; row 2 is considered to have 2ND, MODE, DEL, LEFT, UP, and RIGHT, and row 3 is considered to have ALPHA, XTON, STAT, and DOWN.

I obviously cannot write the code for you (you know your game idea better than me), but here's a rough guideline:
Code: [Select]
Repeat A>=7         // I assume that's what you want to end on. You never told me what it meant, though.
  getKey->K
  If K=<keycode>    // put keycode here
  Then
    <action for a keypress>
  End
  <other actions>
End

Still not sure exactly what you mean by your idea, but hopefully I helped!

Oh, and timer commands will be useful too, but I don't wanna teach you about them unless I know it's precisely what you need.

Offline xMarminq_

  • Full User
  • Join Date: Sep 2016
  • Location: Generic Location
  • Posts: 446
  • Post Rating Ratio: +3/-0
  • Generic Personal Text
    • @UCUWQR30oIW2fRqCNI2IDGIA
  • Gender: Male
Re: My BASIC Questions
« Reply #14 on: November 17, 2016, 12:21:12 am »
I want dat :D (Timer)
ill try it when I get to that part of my project I'm making
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games