[TI BASIC] Optimizing

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

to fix that code, and stop complaining about how basic is limited (which I am, of course, prepared to argue against indefinitely in another topic)

Code: Select all

Repeat Ans 
GetKey->K
End 
Y+(Ans=26)-(Ans=24->Y 
X+(K=34)-(K=25->X
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
User avatar
DJ_O
Calc King
Posts: 2324
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

I'm not complaining about BASIC is limited I'm just saying that we dont have enough vars
Image Image Image Now active at https://discord.gg/cuZcfcF (CodeWalrus server)
Luthar
New Member
Posts: 49
Joined: Wed 13 Apr, 2005 10:09 pm
Location: somewhere lost in translation
Contact:

Post by Luthar »

Kevin wrote:I'm not complaining about BASIC is limited I'm just saying that we dont have enough vars
ain't that the truth...and making an rpg in BASIC is a pain...*mutters* I'll be posting my code up here soon to see if anyone has any suggestions for optimizing...because I KNOW it sucks..lol
Archia...BASIC....ASM....erk...scratch ASM..yep don't know ASM
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

Assembly has only 7 bytes' worth of registers that you can use.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

It's a bit more than that, closer to 20. Still it's about the same size as 3 TIOS real vars.
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

Still, if you ever feel like you're running out of variables in Basic, then Asm is not for you.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
Gambit
Sir Posts-A-Lot
Posts: 252
Joined: Mon 21 Feb, 2005 5:34 am
Location: Laveen, Arizona

Post by Gambit »

DarkerLine wrote:Still, if you ever feel like you're running out of variables in Basic, then Asm is not for you.
Huh? If you're running out of variables in BASIC, then shouldn't you turn to assembly? :? You can have as many "variables" as you want in assembly (RAM permitting) :?
"If SOURCE is outlawed, only outlaws will have SOURCE."
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

I think it was a joke.. if not, I pity his ignorance :?
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Well storing stuff in ram for safekeeping and being able to perform operations with data in asm are 2 different things. Sure you can store 'variables' but you can only perform operations with the data using the registers. And also considering that this is an ACC based system ...

You can store as much stuff in memory as you want in basic too ... just keep stuff in lists etc.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

tr1p1ea wrote:You can store as much stuff in memory as you want in basic too ... just keep stuff in lists etc.
Exactly. And in my opinion this is way simpler than it is in assembly.

I've never run out of variables in Basic though...
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

I've still got about 5-6 variables left to use (out of the A-Z, theta set) for in-game play in Tankies. So yeah, no problems there.. no list use except for option lookup.
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

There's also the finance variables, stat vars if you can figure out how to store to them (it's complicated), unused window boundaries (Tmin, Tmax, thetamin, thetamax, etc.), even USED window boundaries if you don't use the graph screen (just remember to fix them afterwards), table variables (TblInput is a 7-element list), etc.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
User avatar
dysfunction
Calc Master
Posts: 1454
Joined: Wed 22 Dec, 2004 3:07 am
Location: Through the Aura

Post by dysfunction »

If you run out of vars you can always use lists, which only RAM limits the number of.
Image


"You're very clever, young man, but it's turtles all the way down!"
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

This deserves a sticky :)
Image
User avatar
DJ_O
Calc King
Posts: 2324
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

Cool, along with the ASM optimising thread
Image Image Image Now active at https://discord.gg/cuZcfcF (CodeWalrus server)
Post Reply