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.dysfunction wrote:If you run out of vars you can always use lists, which only RAM limits the number of.
[TI BASIC] Optimizing
Moderator: MaxCoderz Staff
-
- Calc Wizard
- Posts: 526
- Joined: Tue 08 Mar, 2005 1:37 am
- Location: who wants to know?
- Contact:
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.
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
-
- Calc Wizard
- Posts: 526
- Joined: Tue 08 Mar, 2005 1:37 am
- Location: who wants to know?
- Contact:
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:
3. For the Circle(3,3,6 command you should really set the window values Xmin Xmax etc in the program.
@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
-
- Calc Wizard
- Posts: 526
- Joined: Tue 08 Mar, 2005 1:37 am
- Location: who wants to know?
- Contact:
-
- New Member
- Posts: 49
- Joined: Wed 25 May, 2005 9:29 pm
- Location: Dallas, TX
- Contact:
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
Kevin i admire all the work you do on the calc so im sorry for offending you
Last edited by hornzfan3211 on Sun 29 May, 2005 9:42 pm, edited 1 time in total.
-
- Regular Member
- Posts: 83
- Joined: Mon 27 Dec, 2004 8:33 pm
- Contact:
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/
If you are interested to see what I am working on now go to http://www.axulyon.com/
-
- Calc Wizard
- Posts: 680
- Joined: Wed 22 Dec, 2004 5:37 am
- Location: West Palm Beach,FL
- Contact:
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.
hmm another post that will not stay her efor long though 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
-
- Calc Wizard
- Posts: 501
- Joined: Sat 28 May, 2005 5:34 am
- Location: Chesapeake, Virginia
- Contact:
I think you misinterpreted it. Although I understand your point, allow me to explain what I meant by it.I dont think your post above will stay on this forum for long.
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'.