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 - meishe91

Pages: 1 ... 115 116 [117] 118 119 ... 207
1741
TI-BASIC / Re: Combining Characters - text sprites
« on: August 08, 2010, 12:09:30 pm »
Oh, you're talking about Dual-Layers. This might be of some use. Trevmeister66 made a dual layer generator a while ago and then I recreated it to include all of the tokens (and made one with his original tokens that is smaller than his). Could be useful.

1742
Miscellaneous / Re: Programming Tutorials, Help, Etc.
« on: August 07, 2010, 11:47:50 pm »
If you want I can see about doing that. I think I have the files on my computer. I can just post it in a thread if I manage it.

1743
Miscellaneous / Re: Programming Tutorials, Help, Etc.
« on: August 07, 2010, 10:14:04 pm »
Ya, I've thought about it. I'll look at it again.

1744
TI-BASIC / Re: Jump Code Explanation
« on: August 07, 2010, 09:49:45 pm »
Thanks :)

1745
Introduce Yourself! / Re: Hi There!
« on: August 07, 2010, 09:48:16 pm »
It seems to be taking longer and longer nowadays :P

But here ya go :)


1746
TI-BASIC / Re: Jump Code Explanation
« on: August 07, 2010, 09:45:09 pm »
Thanks. I have two other explanations like this somewhere in this sub-forum but they are a bit hidden now :P My tutorial thread, located here, has them though if you're interested. It also has links to the other tutorials and guides made by Omnimaga's very own.

1747
Introduce Yourself! / Re: Hi There!
« on: August 07, 2010, 09:43:08 pm »
Welcome here and I hope you enjoy your stay!

Where is this guy's peanuts? :P

1748
TI-BASIC / Re: Jump Code Explanation
« on: August 07, 2010, 09:10:51 pm »
I saw this on United-TI earlier. Awesome job :)

Ya, I uploaded it there first because since I use Weregoose's type face it's easier to type [goose][/goose] instead of everything you have to here :P

Awesome job!  I just have a couple of things to nitpick at. :)

"DelVar ARepeat 0"
I recommend staying away from putting DelVar on the same line as control structures.  This works fine now, but if you try this code you can see what can happen:
For(A,0,1
If not(A
Then
Delvar BIf 1
Then
Disp "HI
End
End
End
Make sense. :D

"There is For(, While, and Repeat that all do differnt things (well sorta, they more just act differently)."
Sorry to nitpick, but I thought it looked too weird to not be a grammar Nazi on. :)  (different)

"If you ever use 0→A, or zero stored into any variable, then replace it with DelVar A, or what ever variable is used. It is much more memory efficient."
Not quite.  It's only more memory efficient if you (ab)use the "extra line" feature of DelVar.  Even then, it only saves you one byte.

==================

Regardless of this constructive criticism, I think this is a wonderful tutorial!  Excellent job!  Thanks Meishe. ;D

Ya, looping commands are really the only thing I ever put them on because I know it won't change them in cases like this.

The typo was just because I typed it all in Notepad first. I thought I got everything but I guess I didn't. Thanks.

Ya, I know it isn't "much" more efficient but it can save space depending on the situation, especially when you need every byte to come off a program.

1749
[OTcalc] Z80-Software / Re: KOS - OTz80
« on: August 07, 2010, 11:13:41 am »
I would like to help but not good enough at programming to really be any help. Sorry.

1750
TI-BASIC / Jump Code Explanation
« on: August 07, 2010, 01:23:04 am »
So I realized that it has been quite a while sine I've done one of these. So, for this one I decided to choose a topic that I really haven't ever seen discussed in tutorials or guides or anything. So here you have it, a code explanation about jumping :)

Without further adue, here is the code I will be working with.

Code: [Select]
ClrHome
8→X
1→Y
DelVar ARepeat 0
getKey→K
Output(X,Y,"_
Y+(K=26)-(K=24
Ans-16((Ans=17)-not(Ans→Y
X-A→X
A-2(X=5→A
If X=8
DelVar A
Output(X,Y,"π
A+(K=25 and X=8→A
rand(11
End

Note:
This is NOT the best example for jumping. It is more based for concept. If someone would provide me code that does the same thing as this program (in terms of looking the same) then I will happily disect that code too for everyone.

Ok, so I will just go line by line and do this and explain as I go. I will then create a commented set of code at the bottom that covers everything too.

Let's get started.

ClrHome: I'm assuming most of you know what this does. But for those who are very beginners this command clears the homescreen of everything that is on it. This is also the operating systems way of doing this. There are multiple ways of clearing the screen with code but this will be your fastest and most memory efficient way.

8→X and 1→Y: Again this is a fairly simple thing to know. But basically you are storing the integer (in this case anyways) into the variable. The command is used to store what ever is on the left side into what is on the right. So in these examples we are storing eight into the variable X and one into Y.
But the command isn't just used for integers and variables. You can store things such as strings (a set of characters) into a string (represented on the calculator as Str1, Str2, etc.). An example of this would be storing "HELLO WORLD!" into Str1. The code would look like:

Code: [Select]
"HELLO_WORLD!→Str1
But this still isn't all. You can store all sorts of things such as matricies, lists, dimetions, plus some other stuff. But that is all for a different guide ;)

DelVar ARepeat 0: This is actually two lines of code in one. It is split up into DelVar A and Repeat 0. First, the DelVar A part. What DelVar does is clear out a variable and stores zero into it or if it is used with a list or matrix or something it completely resets it. Now for the Repeat 0 part. Repeat is one of the three main looping commands. There is For(, While, and Repeat that all do different things (well sorta, they more just act differently). I will only explain Repeat for the sake of this break-down. What Repeat does is repeat a block of code until a certain condition is true. This means that the way this works is that you put a Boolean conditional as the argument. A Boolean conditional is statement that will either return true or false (one or zero, one being true and zero being false). This are often recognized by their use of =, , , >, , and <. Not always, but usually. So since Repeat repeats until true, and zero means false, this loop will loop indefinetly.

Tip:
If you ever use 0→A, or zero stored into any variable, then replace it with DelVar A, or what ever variable is used. It is much more memory efficient. Also, I forgot to mention that you can stack multiple DelVars in a row and before any other command or length of code. An example is:

Code: [Select]
1→A
Ans→B
Ans→C
Ans→D
Repeat 0
getKey
If Ans
DelVar ADelVar BC+D→A
End

When you break the code and see what A is it will equal two.

getKey→K: So the getKey command is a standard in games and is fairly simple. It is the command that detects key presses. Each key is assigned a different number. For the most part each row starts at a multiple of ten plus one number, so the first row starts with eleven. Then you just count outwards to the right until the end of the row then, instead of wrapping around, the next row starts with that first buttons key number on the line before plus ten. So row two, the row with [2ND], would start with twenty-one. A good way to find out which keys are which just use this program:

Code: [Select]
Repeat 0
getKey
If Ans
Disp Ans
End

Note:
All the keys have a number assigned EXCEPT for the [ON] button. In TI-BASIC that key will always break the code execution.

Output(X,Y,"_: Output( is yet another simple command. It simply outputs what ever is in the third argument on to the homescreen at point (Y,X). The y-coordinate, which is the first argument, can go from one to eight while the x-coordinate can be from one to sixteen. If you go beyond this you will get an ERR:DOMAIN error. However this does not restrict you to using only sixteen characters per line. When the output goes beyond column sixteen it will wrap down to the next line. Here is an example of this:

Code: [Select]
"*
For(A,1,7
Ans+Ans
End
Output(1,1,Ans

So the point of this line in particular is that it is puting a single space at where the future pi guy was, clearing that spot and erasing a trail. If you didn't have this you would leave a trail of pi characters each time you moved or jumped.

Y+(K=26)-(K=24: This is the start of where that Boolean logic I talked about comes into play. What we have here is the Y variable, which holds our x-coordinate of our character, being affected by which key is pressed (remember, we stored the value from getKey into K). If the the key pressed was the left arrow then K will be equal to twenty-four then the Boolean conditional (K=24) will equal one. This in turn subtracts one from Y. If you push the right arrow button then K will equal twenty-six and then add one to Y.

Ans-16((Ans=17)-not(Ans→Y: This line is basically a run on of the last line. It take the answer from it and will either subtract or add sixteen to that number if the number is seventeen (subtracts from) or zero (adds to) because both of these will result in a ERR:DOMAIN. If it doesn't equal either of those then it will just store what ever number was the answer to Y. So, basically, this line is the line that makes the pi character wrap around the screen if he goes off one end.

X-A→X: As talked about when explaining the Output( command, X is our y-coordinate. So since this is about jumping we need some type of variable that changes that affects when our guy jumps, that is the A variable. Basically though this is subtracting what ever value is in A from X to give the appearance of jumping.

A-2(X=5→A: Hey, look, another Boolean statement. What is happening here is that we are constantly storing A into A but if X equals five then it will subtract two from A and store negative one to A (the only way for X to equal five is if the guy is jumping and A will equal one at that point).

If X=8: our first If statement. It's pretty simple. If the statement is true, it will execute THE NEXT LINE, not just the next command. This is why on the next line that DelVar A is on a line of it's own instead of being DelVar AOutput(X,Y,"π.

DelVar A: As explained before DelVar just deletes what ever is in it's argument. In this case it is a variable so it sets the value to zero. This only happens though once X becomese eight again after a jump.

Output(X,Y,"π: This is pretty obvious now. It will output the Greek letter pi at the cooridnates (Y,X). This is what will be jumping too.

A+(K=25 and X=8→A: This is where our jumping initially starts. A will always be equal to zero unless the character is in the middle of a jump (then it will be equal to either one or negative one). If you push the up arrow key it will store a value of twenty-five to K  which meets the first part of this conditional. Then we need X to be equal to eight, which is when the character is on the ground. As long as both of those conditions are true then you will initiate a jump by storing one into A.

rand(11: This is basically here to slow this loop down. Without it here the loop will run to quickly for you to see what is happening during a jump. You can always fine tune this to what you like by messing with the number. But basically how this works is that the rand command creates a "random" number (I say "random" because technically a computer can't produce a truly random number). When you add the second argument of (11 then you are telling it to create an abitrary list of random numbers which takes a bit to create because calculating these random numbers takes time.

End: Woo, finally to the end. This just marks the end of our Repeat loop.

Commented code time:

Code: [Select]
ClrHome  \\Initially clears the homescreen of any junk previously on it.
8→X \\Stores the integer eight into the variable "X."
1→Y \\Stores the integer one into the variable  "Y."
DelVar ARepeat 0 \\Our double line. First it deletes the integer previously stored in variable "A" and replaces it with zero. Then it starts an indefinite loop.
getKey→K \\When you press a button it stores what ever value from the key you pressed into the variable "K."
Output(X,Y,"_ \\Outputs a single space at the coordinates (Y,X) to erase the trail that would be left behind.
Y+(K=26)-(K=24 \\This controls the movement left and right. If the left arrow is pressed then twenty-four is stored to "K" and subtracts one from "Y."
Ans-16((Ans=17)-not(Ans→Y \\Takes the answer from the previos line and either stores it as is, subtracts sixteen if the answer was seventeen or adds sixteen if the answer was zero.
X-A→X \\Applies our "jumping" variable to the variable "X."
A-2(X=5→A \\When our character reaches three spaces up in the jump it will subtract two from "A" to make the guy go back down.
If X=8 \\If the value of "X" equals eight then it will execute the next line.
DelVar A \\Deletes the integer stored to "A" and replaces it with zero if the value in "X" equals eight.
Output(X,Y,"π \\Outputs our character, the Greek letter pi, at the coordinates (Y,X).
A+(K=25 and X=8→A \\Adds one to the "A" variable if the up button is pressed the guy is on the floor. This initiates the jump.
rand(11 \\Effectively slows down our loop enough to let us see what is happening with the jump. Creates an abitrary list of eleven random numbers.
End \\Marks the end of our Repeat loop.

Ok, we have reached the end. Hopefully you have learned something. Again, this is a poor example of jumping code and there are much better examples out there. If someone provides me with a set of code that does this same thing but is much better I will happily explain it and do a code breakdown for it.

Thanks:
ztrumpet and nemo: For helping me with the concepts of creating simple jumping code. Thanks guys :)

I really hope this has been helpful and enjoy :)

1751
Miscellaneous / Re: RLDE - Real-life Development Environment
« on: August 06, 2010, 08:02:22 pm »
Oh ya, I thought it was something like [img=40,40]URL[/img] or something like that. Thanks though.

1752
OTcalc / Re: Let's build our own calculator!
« on: August 06, 2010, 03:46:25 pm »
I'm sure someone will. If not someone, then a group of people can do it or something.

1753
OTcalc / Re: Let's build our own calculator!
« on: August 06, 2010, 03:11:08 pm »
just a thought, maybe we could have a small back-light that you can turn off and on, i hate being in a classroom where i have trouble seeing  my screen

I like the idea. But that will probably be a much later addition because it's not a necessity.

1754
OTcalc / Re: Let's build our own calculator!
« on: August 06, 2010, 03:08:56 pm »
" show up to sixteen (4-bit) different shades, "
"with 8 bits per sampled pixel, which allows 256 different intensities "

;)

Besides that, I think color would be for the ARM if not both.

Ah ok, haha I didn't actually read it all I just looked at the boldfaced words on the side :P

1755
OTcalc / Re: Let's build our own calculator!
« on: August 06, 2010, 03:02:15 pm »
Grayscale is definitely on the list for OTZ80 todo. (Grayscale = 4 bit color / 16 levels, like Nspire)
100% pretty color is on the list for OTARM though. ;)

I'm hoping we can get TI backward compatibility, since I don't exactly want to leave years of work behind.
BTW, if you are suggesting software stuff, redirect them to SirCmpwn. His OS, KnightOS, is going to be on this calc. ;)

EDIT: For more info on the eZ80, lookie here: http://dkc1.digikey.com/us/en/tod/Zilog/eZ80Acclaim/eZ80Acclaim.html

16-level grayscale is not 4 bit color. It is 8 bit grayscale. Sorry, but there is a difference.
Actually, it is 4-bit grayscale ;)

Really? Sorry, Wikipedia is just saying it is 8 bit grayscale.

Pages: 1 ... 115 116 [117] 118 119 ... 207