Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dinosteven

Pages: [1] 2 3 ... 13
1
TI-BASIC / Re: Best TI-BASIC command of all time?
« on: March 16, 2014, 08:53:54 pm »
On a side note, cumSum gotta have the worst TI-BASIC command name  of all time (I already brought that NSFW joke up before, but yeah the name looks a bit questionable) O.O

Maybe TI thought that students using that calculator would not be familiar yet with that stuff so they didn't mind using a dirty command name :P
:P
Then again, how are you gonna shorten "cumulative" in another way?

2
TI Z80 / Re: zStart - an app that runs on ram clears
« on: March 14, 2014, 03:17:02 pm »

Just me running over some random code and scrolling. At the end, I kinda demonstrate how it breaks when Mathprint is enabled. Well, Mathprint sucks, too bad.

3
TI-BASIC / Re: BEST TI-BASIC COMMAND OF ALL TIME???
« on: March 12, 2014, 11:58:06 am »
Does Ans qualify as a "command", per se? Yeah, it's extremely useful for optimizations, but I'm pretty sure it's categorized as a variable.
Again, I'm anti-Goto, and that was just a copy paste from Xeda on TIBasicDev forums a while back.

4
TI-BASIC / Re: BEST TI-BASIC COMMAND OF ALL TIME???
« on: March 12, 2014, 11:10:47 am »

Personally, I stand by the Case Against Goto: [size=78%]http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF[/size]

...but...Quoth Xeda:



Personally, for TI-BASIC and many other languages, I find Goto is excellent. Having written several programming languages and evaluating the code for the TI-BASIC parser, Goto has one main disadvantage and one main advantage, if used properly, and one massive advantage if used improperly like a pro, and one disadvantage if used improperly like a new programmer:


Speed wise, in TI-BASIC, Goto will be slower than While, Repeat, and For(. This is because the BASIC parser stores data in its operator stack telling precisely where to jump upon looping. If I remember correctly, it stores the variable name, and the offset into the variable for where the loop starts. This is still pretty slow, and there are more complicated things that happen, too, but it basically lets the parser use a look-up table (LUT) for loops. Gotos on the other hand must search for the label in the program. If the label is near the end of a program that is >10000 bytes, for example, it will be noticeably slower jumping there than to the beginning. However, this consumes no memory.


There is a misconception that Gotos and Lbls can cause memory errors. This is not true. It is like saying guns kill people. It's not true. They may help, but ultimately, it is somebody else abusing them that causes it. In reality, While, Repeat, and For( cause the memory leaks. Remember how I said that they push data onto an operator stack? That data only get removed on completion of the loop. If you use Goto to improperly exit the loops, then that data doesn't get taken offnot necessarily true; see below and reentering that loop causes it to push again, and again, and again, eventually making you run out of RAM.


Somebody who is versed enough in the TI-BASIC language knows that this can actually be useful for creating a structure not included in TI-BASIC, but should have been -- subroutines. The parser removes an item from the operator stack once it reaches an End. So what you could do is a complicated rebranching of a While loop using Goto:
Code: [Select]


                While A>0 If remainder(A,2 Goto 1 /  | /   | /----------    | Lbl 1              | Disp 1          Disp 0 int(.5A→A       .5A→A End             End
*btw, formatting got off here
Looking at it this way, you see that it won't actually cause a memory leak because the parser doesn't care where or when it comes across an End. As long as it does, reach one, it will jump back to the start of the loop. However, in actual BASIC code, because it is linear, it might look something like the following:
Code: [Select]
While A>0 If remainder(A,2 Goto 1 Disp 0 .5A→A End Lbl 2 <<do stuff now that the loop is over>> Lbl 1 Disp 1 int(.5A→A End Goto 2   ;in case A becomes 0 because of this branch, it doesn't loop back, so we have to manually jump there.
Looking at it this way, you see that it won't actually cause a memory leak because the parser doesn't care where or when it comes across an End. As long as it does, reach one, it will jump back to the start of the loop. However, in actual BASIC code, because it is linear, it might look something like the following:


While this is by no means an efficient application of this idea, here is a program where I used that trick quite a bit to make a subroutine for sprite drawing, saving, and items menu so that I could call the routine at any point in my program without using sub programs or rewriting the routine.


Needless to say, I think Lbl and Goto are very useful. They shouldn't be used in places where While, Repeat, and For( are more efficient, but in TI-BASIC, where efficiency is key, Goto has its place.
[size=78%]






...and, in an effort to be on topic, my favorite command is seq(), with the ability to create lists of all kind, to be manipulated in many ways. It's very versatile.[/size]

5
Computer Programming / Re: Finding if a point falls within an angle
« on: January 20, 2014, 10:29:11 pm »
EDIT: Geometry fail there.

6
Computer Programming / Re: Finding if a point falls within an angle
« on: January 20, 2014, 10:04:44 pm »
Code: (java) [Select]
double dist = Math.sqrt((xPos - b.xPos)*(xPos - b.xPos) + (yPos - b.yPos)*(yPos - b.yPos));

if(dist < 0){
    dist = .001;
}
Erm, distance from a sqrt shouldn't give you a negative... I don't believe that if conditional will ever be fulfilled.

7
General Calculator Help / Re: Graph X= Equations on the TI-83+ Series
« on: December 19, 2013, 10:14:05 pm »
First, change the increment from .1 to ΔY; that way, it's accurate.
Secondly, I think the problem is undefined things. The calculator deals with this by not graphing it, but in the program, it's an error. To deal with this, you'll have to use an If to catch all potential errors. I dunno, checking if it's real will definitely get rid of some. If only TI BASIC had a catch() command... You'll have to manually find all possible errors.

8
Axe / Re: Basic in Axe
« on: September 22, 2013, 01:53:28 pm »
It's been an hour lol... One of the Axe/ASM gurus (Runner) will likely find this within a day.

9
TI Z80 / Re: AxIDE: An Axe IDE
« on: September 21, 2013, 09:56:55 pm »
Don't worry! The most you can be off is 95 pixels!
...jk

It looks really nice now; as for the inversion: Both the arrow and the inversion look fine. But the left pic of the inversion looks horrendous somehow because I'm somehow seeing the gmail logo rather than a lock. Go with the right pic of the inversion.

10
TI Z80 / Re: AxIDE: An Axe IDE
« on: September 21, 2013, 07:42:26 am »
It looks a little messy. Perhaps you could add a line separating the program name and the extra info?

11
TI Z80 / Re: CSE BASIC Graph Screen Snake
« on: July 31, 2013, 09:36:15 pm »
Yeah, I was intending to, but I wasn't sure how he liked to be credited.

12
TI Z80 / Re: CSE BASIC Graph Screen Snake
« on: July 31, 2013, 09:00:54 pm »
Update - added a pause function and it now displays the screen. Also, I actually looked at Weregoose's code and found a few optimizations I could make, while getting this from him:
Quote
Based on a program written by Weregoose from http://www.cemetech.net

That in the program description would make me happy.
So I added it as a comment to my code, adding bytes to the size to 512 lol. I'll upload it when I find my cord.

13
TI Z80 / Re: CSE BASIC Graph Screen Snake
« on: July 31, 2013, 07:45:26 pm »
Yes. The information already has to be on the screen, so you might as well access that information rather than create a second database of information.
 What's the resolution of your Casio calc? If it's very large, that may have something to do with the slow testing. idk

14
TI Z80 / Re: CSE BASIC Graph Screen Snake
« on: July 31, 2013, 09:58:44 am »
Absol-utely correct! It should be noted that the idea for this pathfinding tail eater didn't come from me... it came from Weregoose. I simply coded it.

15
TI Z80 / Re: CSE BASIC Graph Screen Snake
« on: July 31, 2013, 12:31:46 am »
Haha no, I'm not one of those people. Any piece of code that an author worked hard on is worth a lot, even if it's just a Hello world prog or another quadratic formula.

Pages: [1] 2 3 ... 13