[TI BASIC] Optimizing

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

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

Post by DarkerLine »

dysfunction wrote:If you run out of vars you can always use lists, which only RAM limits the number of.
I try not to use lists for unrelated elements, if you're going to access them always with a constant index (for example, L1(1), L1(2), etc.) there's no point, but if you're going to apply operations to the whole list, or access a variable element of it (for example, L1(I)), then it's hard to replace with real variables.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
mnc2fan
Extreme Poster
Posts: 441
Joined: Fri 11 Mar, 2005 4:32 pm

Post by mnc2fan »

I've been messing with some things in BASIC, archiving, unarchiving, text, pxl-change, output, input, interupts. So far I have put together a well, interesting program. I see a few things that could be optimized, just not sure how. Some help and advice would be nice. :twisted: :twisted:

Code: Select all

archive A                  ;used for password
clrdraw
circle(3,3,6
text(19,51,"circle                ;places text in center of circle
dim(rand(50
for(x,51,71
pxl-change(25,x
text(10,10,"enter
text(25,10,"user
text(54,36,"password
dim(rand(2
end
dim(rand(150
clrdraw
input A                              ;A=password
archive A                            archives password or number
Lbl Y
clrhome
input B
unarchive A
clrhome
if B<>A
then
output(4,1,"the password
output(5,1"entered is not correct
dim(rand(150
goto Y
<ahref="http://spreadfirefox.com/community/?q=a ... t=73"><img border="0" alt="Get Firefox!" title="Get
digiTsai
New Member
Posts: 13
Joined: Wed 30 Mar, 2005 12:48 am
Location: SC, USA

Post by digiTsai »

:o its possible to archive and unarchive through a program?
User avatar
DJ_O
Calc King
Posts: 2323
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

only pictures, variables, not programs. You need codex to archive programs
ImageImageImageImage
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

Or any other library that allows you to either archive/unarchive programs or run assembly opcodes.

@mnc2fan:
1. you don't need the Archive A at the beginning, in fact it might crash the program when you try to input it.
2. You could replace the Lbl Y/Goto Y with a Repeat loop:

Code: Select all

Repeat B<>A
Archive A
clrhome 
input B 
unarchive A 
clrhome 
if B<>A 
then 
output(4,1,"the password 
output(5,1"entered is not correct 
dim(rand(150 
End
End
3. For the Circle(3,3,6 command you should really set the window values Xmin Xmax etc in the program.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
digiTsai
New Member
Posts: 13
Joined: Wed 30 Mar, 2005 12:48 am
Location: SC, USA

Post by digiTsai »

He probably should if he sets it as a starting program, so if someone turns the calc on, they can't just take the batteries out to clear the ram and the variable along with it if they can't get past the password.
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post by DarkerLine »

When you Archive A and then Input A I think you get an error.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
Patori
Maxcoderz Staff
Posts: 1479
Joined: Sat 18 Dec, 2004 3:51 am
Location: Toledo, Ohio, USA

Post by Patori »

Kevin wrote:only pictures, variables, not programs. You need codex to archive programs
why didn't TI allow this? Oh yeah.... I remember prgmA tries to Archive itself while running... hehe...
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...
hornzfan3211
New Member
Posts: 49
Joined: Wed 25 May, 2005 9:29 pm
Location: Dallas, TX
Contact:

Post by hornzfan3211 »

EDIT: sorry for what seemed to cause another "BASIC is for idiots" debate.

Kevin i admire all the work you do on the calc so im sorry for offending you :cry: :cry:
Last edited by hornzfan3211 on Sun 29 May, 2005 9:42 pm, edited 1 time in total.
Hook 'em Horns

Check it out--new ti forums: http://s12.invisionfree.com/RCT_3_Soaked/index.php
chronoflare
Regular Member
Posts: 83
Joined: Mon 27 Dec, 2004 8:33 pm
Contact:

Post by chronoflare »

Never doubt the world's population of idiots.
Long retired from this forum. For all of those who are still coding here back from the days I posted, rock on.
If you are interested to see what I am working on now go to http://www.axulyon.com/
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

BASIC was MADE for idiots...
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
User avatar
DJ_O
Calc King
Posts: 2323
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

I dont think your post above will stay on this forum for long. btw look at my signature first link
ImageImageImageImage
lloydkirk1989
Calc Wizard
Posts: 680
Joined: Wed 22 Dec, 2004 5:37 am
Location: West Palm Beach,FL
Contact:

Post by lloydkirk1989 »

edit: its not worth it...makes me mad that people make such ignorant remarks
Last edited by lloydkirk1989 on Sun 29 May, 2005 9:10 pm, edited 1 time in total.
User avatar
DJ_O
Calc King
Posts: 2323
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

hmm another post that will not stay her efor long though :roll: still if TI decided to disable prgm archiving in programs there is a reason: SOME people would be stupid enough to archive the running program, causing an error or even a crash. It's annoying for game programmers though, but its because TI philosophy is that calcs are for maths, not gaming :roll:
ImageImageImageImage
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

I dont think your post above will stay on this forum for long.
I think you misinterpreted it. Although I understand your point, allow me to explain what I meant by it.

When I said, 'BASIC was MADE for idiots', I meant that the language was not created with people that have an IQ higher than 12 in mind- it's meant to be crash proof, so that no unknowing buyer makes a quick program, then ends up crashing their calculator.

What I did not say was 'BASIC is ONLY for idiots'... meaning that there are people who can make it almost as powerful as assembly- like you, Kevin (btw we have the same name ;)). So, T.I is not going to risk the situation Patori stated.

Which means that, when they were deciding whether or not to include archiving programs, they said 'BASIC is not being made for advanced programmers. So if it can crash the calc in the hands of an idiot, we won't include archiving prgms'.

Sorry for the long explanation, I just didn't want that post to be take the wrong way. Remember, there is a difference between MADE for, and ONLY for. Perhaps I should have said 'made with idiots in mind'.
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
Post Reply