Author |
Message |
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 10 Dec 2005 12:20:07 pm Post subject: |
|
|
There already is an excellent library called flib (it even supports grayscale) for the TI-89. And pure Basic sprites work quite well too, their only limitation is the inability to use the full screen for drawing.
Last edited by Guest on 19 Jan 2008 12:26:38 pm; edited 1 time in total |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 10 Dec 2005 12:30:43 pm Post subject: |
|
|
I assume this flib is found in the ticalc.org file archives?
DarkerLine wrote: CyclePic works pretty well for grayscale if you do it right.
[post="63982"]<{POST_SNAPBACK}>[/post]
Any other sprite commands that might be useful in pure Basic? |
|
Back to top |
|
|
bukwirm
Member
Joined: 06 Dec 2005 Posts: 233
|
Posted: 10 Dec 2005 12:57:57 pm Post subject: |
|
|
calcul831415 wrote: I assume this flib is found in the ticalc.org file archives?
DarkerLine wrote: CyclePic works pretty well for grayscale if you do it right.
[post="63982"]<{POST_SNAPBACK}>[/post]
Any other sprite commands that might be useful in pure Basic?
[post="63986"]<{POST_SNAPBACK}>[/post]
CyclePic is a actually a built-in 89 function - look in the catalog. I strongly advise looking over the manuel before you try to use those routines - it may save you some time.
Other sprite routines: pg 628 of the 89T manuel - there are a lot.
Last edited by Guest on 10 Dec 2005 12:58:21 pm; edited 1 time in total |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 10 Dec 2005 01:39:44 pm Post subject: |
|
|
thanks!
edit: Can somebody explain to me why this doesn't work either? It looks okay to me.
Code: newlist(2)->tfile
zfile1->tfile
InputStr "What is you name?",s
s->tfile[2]
zfile1 was also a 2 element list that started out with the values {1 "File 1"}
edit:
So when you guys make Basic games, it's really just a giant function loop where you have code before the loop to load level/map data and code after the loop that shows what happens after the level/map is beaten?
Last edited by Guest on 11 Dec 2005 01:42:51 pm; edited 1 time in total |
|
Back to top |
|
|
bukwirm
Member
Joined: 06 Dec 2005 Posts: 233
|
Posted: 13 Dec 2005 12:34:34 pm Post subject: |
|
|
It worked for me. I assume you're trying to get tfile = {1, "user_input"} and that you started out by {1, "File1"}->zlist.
What exactly are you trying to do? |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 13 Dec 2005 03:38:10 pm Post subject: |
|
|
Ya, I'm trying to load the contents of zfile into tfile, which is a local list, and then rename the file by changing the second element (the string). My program displays the file name by displaying whatever is in the 2nd element of tfile/zfile or anyother list.
For some reason, my calc won't store the inputed string into tfile's second element. It says there is a dimension error or argument error.
btw, does anybody know a way that I can store an ebook like copy of ASM in 28 Days on my Ti-89? That's be really helpful for me because then I could learn ASM when I'm bored in class.
@burkwirm: Here's the code so you have a better idea of what I'm trying to do.
Code: ()
Prgm
Local iquit,files
Local tfile
Local a,n,i,s
Define files()=Prgm
ClrIO
Output 0,0,"Select file:"
Output 15,8,zfile1[2]
Output 23,8,zfile2[2]
Output 31,8,zfile3[2]
newList(2)»tfile
15»a
0»n
While n13
Output a,0,"*"
getKey()»n
If n0
Output a,0," "
If n=338 Then
a-8»a
If a=7
31»a
EndIf
If n=344 Then
a+8»a
If a=39
15»a
EndIf
EndWhile
If a=15
zfile1»tfile
If a=23
zfile2»tfile
If a=31
zfile3»tfile
EndPrgm
Define iquit()=Prgm
FnOn
ClrIO
DispHome
Stop
EndPrgm
FnOff
Lbl start
ClrIO
Output 0,63,"Zenith"
Output 8,28,"An I/O Screen RPG"
Output 16,43,"by Jason Lee"
Output 32,53,"Load Game"
Output 40,53,"New Game"
Output 48,53,"Quit"
Output 64,0,"¨2006"
32»a
0»n
While n13
Output a,47,"*"
getKey()»n
If n0
Output a,47," "
If n=338 Then
a-8»a
If a=24
48»a
EndIf
If n=344 Then
a+8»a
If a=56
32»a
EndIf
EndWhile
If a=48
iquit()
files()
If a=40 Then
ClrIO
InputStr "Enter your name",s
s»tfile[2]
EndIf
EndPrgm
Last edited by Guest on 13 Dec 2005 06:15:45 pm; edited 1 time in total |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 13 Dec 2005 08:31:06 pm Post subject: |
|
|
When you declare a variable as Local, it can't be used by any of your subprograms unless you pass it as a parameter (in which case it won't be passed back). It would probably be simpler to omit the line saying "Local tfile" (and any other variables you have a problem with) and put a DelVar tfile where you quit.
It's also unnecessary to have files() as a separate program if you only call it once. |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 13 Dec 2005 09:08:37 pm Post subject: |
|
|
So i'm guessing local programs have issues if there isn't enough RAM? Might as well do archive/unarchive for some of the subprograms? |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 13 Dec 2005 09:27:49 pm Post subject: |
|
|
The advantage of using Local to declare a subprogram is that it gets deleted afterwards. With all variables, you have 3 options:
1. Store it globally and never get rid of it. Best used with a game that has its own folder. This is virtually the only option for picture variables. Another problem is, unless you make an installation program, the user has to send these to the calculator along with the main program which can get annoying.
2. Make it global, then use DelVar to get rid of it when you exit. Perhaps the best solution; however, if you don't switch to another folder, you risk overwriting important variables. Also, you might end up having several DelVar statements in the program if you exit at different points.
3. Make it a local variable using a Local statement. The variable, when declared in this fashion, will never overwrite a global one and will automatically be deleted. However, this is problematic with subprograms, who can't use the variable. This is the only way to have variables in functions. Keep in mind the situation here is different from an actual computer language due to the near absence of pointers.
The best solution is to mix and match from all three for whichever allows for the simplest code in a particular case.
Edit: on the use of archived variables:
This is only relevant for #1 here. You can access an archived variable without unarchiving it (on the TI-89 series only), but you can't edit it. Don't unarchive unless you have to or unless it gives you a speed boost (I haven't checked whether it would, but my intuition tells me that it does). Subprograms (and even main programs) could be kept archived - run a program at least once (to tokenize it) before you archive or the calculator will tokenize it every time you run it.
Last edited by Guest on 13 Dec 2005 09:31:14 pm; edited 1 time in total |
|
Back to top |
|
|
bukwirm
Member
Joined: 06 Dec 2005 Posts: 233
|
Posted: 14 Dec 2005 12:04:11 pm Post subject: |
|
|
I usually use DarkerLine's #2 solution. You just need to make sure you give your variable unique names. Also, I usually write a subprogram which is called when the main program ends to delete any extra variables and restore and settings I changed. NOTE: You cannot call the exit subprogram exit(). |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 14 Dec 2005 04:47:16 pm Post subject: |
|
|
Thanks you guys!
Anyways, I've begun storing ASMin28 in NoteFolio form on my Ti-89. I hope sigma doesn't mind, but that may be the only way I'm going to progress in ASM since I'm so busy.
I wish I had started learning this stuff years ago. |
|
Back to top |
|
|
sgm
Calc Guru
Joined: 04 Sep 2003 Posts: 1265
|
Posted: 14 Dec 2005 04:49:34 pm Post subject: |
|
|
calcul831415 wrote: Anyways, I've begun storing ASMin28 in NoteFolio form on my Ti-89. I hope sigma doesn't mind, but that may be the only way I'm going to progress in ASM since I'm so busy.
[post="64414"]<{POST_SNAPBACK}>[/post]
That is a blatant contravention of the license. I'm going to sue.
Last edited by Guest on 14 Dec 2005 04:50:11 pm; edited 1 time in total |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 14 Dec 2005 04:51:32 pm Post subject: |
|
|
I'm sry, I'll take it off my calc then.
edit: what license?
Last edited by Guest on 14 Dec 2005 04:52:07 pm; edited 1 time in total |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 14 Dec 2005 04:56:41 pm Post subject: |
|
|
The license: http://nwps.ws/~dragonfire/Asmin28/gfdl.html
Quote: You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You'd better have a lot of RAM available. |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 14 Dec 2005 04:56:55 pm Post subject: |
|
|
It's not like I'm selling it Sigma. I'll get rid of it when I'm done learning (in the middle of chem class) I'm not even going to distribute it either. If it's really that bad, then PM me and I'll take them out.
That's why I like my Ti-89Titanium
Last edited by Guest on 14 Dec 2005 05:02:14 pm; edited 1 time in total |
|
Back to top |
|
|
Brazucs I have no idea what my avatar is.
Super Elite (Last Title)
Joined: 31 Mar 2004 Posts: 3349
|
Posted: 14 Dec 2005 04:58:24 pm Post subject: |
|
|
I'm pretty sure he was kidding... |
|
Back to top |
|
|
sgm
Calc Guru
Joined: 04 Sep 2003 Posts: 1265
|
Posted: 14 Dec 2005 05:14:52 pm Post subject: |
|
|
YA RLY.
GFDL == you can do whatever. Fun's over. Back on topic. |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 14 Dec 2005 05:37:07 pm Post subject: |
|
|
Don't scare me like that!
Anyways, since I have no experience with using strings to store data with any ti-calc i need to know:
can you use logic operators on strings? |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 14 Dec 2005 05:45:47 pm Post subject: |
|
|
logic operators are AND, OR, XOR, etc. No, you can't use them on strings, nor is there a single good way to define them for strings.
If you're referring to =, <, >, etc. then yes, you can use them for strings. Less than and greater than work alphabetically, but be warned that uppercase and lowercase letters can be problematic. (This is for the TI-89 only. The 83+ defines = and !=, but other comparisons won't work for strings)
What I want to know is:
How come you couldn't have taken your calculator, stored two strings to x and y, and checked?
Last edited by Guest on 14 Dec 2005 05:46:45 pm; edited 1 time in total |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 14 Dec 2005 05:47:44 pm Post subject: |
|
|
Got taken away from me during class. I'll have to get back it later.
Last edited by Guest on 14 Dec 2005 05:48:07 pm; edited 1 time in total |
|
Back to top |
|
|
|