I've just started on it, and it is possible to do, with relatively high speed. I'll post a screeny as soon as I have something interesting to show.
homescreen for now, but it could easily be done on graphscreen too, although its limited to 9 rows of display anywhere I do it, because I use 1 string for each row, and 1 string for other stuff. I could probably be able to condense it to use only 1 string for all rows eventually.
So do you just use a variable to indicate where to start in the string and just increment every frame before displaying substrings?
- jpez
- Underboss of Cemetech (Posts: 2778)
- 03 Jan 2006 04:28:55 pm
- Last edited by jpez on 03 Jan 2006 04:42:33 pm; edited 1 time in total
Wouldn't it be faster (and perhaps easier and smaller as well) to just have one string that scrolled up/down instead? *Goes to try on calc.*
EDIT: Yes it is. I would post the source, but TI Connect is being finicky and I'm being lazy.
Code:
EDIT: Yes it is. I would post the source, but TI Connect is being finicky and I'm being lazy.
Code:
[Code goes here]
Smaller, yes.You could also (although this would be overly slow) do something like:
Code:
And repeat for each string, or about the same thing with one large string.
This way you wouldn't have a rapidly increasing amount of wasted mem and the strings could be kept at 27b apiece, 208b total.
Code:
...
:Sub(StrX,1,length(StrX)-1->StrX
...
And repeat for each string, or about the same thing with one large string.
This way you wouldn't have a rapidly increasing amount of wasted mem and the strings could be kept at 27b apiece, 208b total.
My code uses one string and goes VERY fast. It's also scalable to any size/position on the screen including the graph screen.
BASIC Code wrote:
:" RANDOM STUFF "→Str2
:For(I,1,8*16
:Str1+sub(Str2,randInt(1,length(Str2)),1→Str1
:End
:While 1
:Output(1,1,Str1
:"Replace 2nd term with next row
:sub(Str1,17,length(Str1)-17)+sub(Str1,1,17→Str1
Generated by SourceCoder, © 2005 Cemetech
Thur we go. :For(I,1,8*16
:Str1+sub(Str2,randInt(1,length(Str2)),1→Str1
:End
:While 1
:Output(1,1,Str1
:"Replace 2nd term with next row
:sub(Str1,17,length(Str1)-17)+sub(Str1,1,17→Str1
Generated by SourceCoder, © 2005 Cemetech
Hehe, I've discovered that using sub( judiciously can result in some EXTREMELY fast code. Lemme do a little modifying to make it sidescroll...
Like this.
Very useful command.
Very useful command.
BASIC Code wrote:
:ClrHome
:" + < + - ++ / .."→Str2
:" →Str1
:For(I,1,8*16
:Str1+sub(Str2,randInt(1,length(Str2)),1→Str1
:End
:sub(Str1,2,length(Str1)-1→Str1
:While 1
:Output(1,1,Str1
:sub(Str2,8randInt(0,2)+1,8→Str3
:" "→Str4
:1→A
:For(I,2,length(Str1)-14,16
:Str4+sub(Str1,I,15)+sub(Str3,A,1→Str4
:A+1→A
:End
:sub(Str4,2,length(Str4)-1→Str1
Generated by SourceCoder, © 2005 Cemetech
Here is the side-scrolling version. Although it's not FAST it's fast for BASIC. I sincerely doubt it's possible to write anything faster that doesn't use asm-libs or specific variables for positions (like my tunnel dodge). :" + < + - ++ / .."→Str2
:" →Str1
:For(I,1,8*16
:Str1+sub(Str2,randInt(1,length(Str2)),1→Str1
:End
:sub(Str1,2,length(Str1)-1→Str1
:While 1
:Output(1,1,Str1
:sub(Str2,8randInt(0,2)+1,8→Str3
:" "→Str4
:1→A
:For(I,2,length(Str1)-14,16
:Str4+sub(Str1,I,15)+sub(Str3,A,1→Str4
:A+1→A
:End
:sub(Str4,2,length(Str4)-1→Str1
Generated by SourceCoder, © 2005 Cemetech
Of course it could (there are some unnecessary quotes), but I am a TI-BASIC god and thus beyond any sort of "optimizing."
I got it down to use one string, and started on an interesting map. I didn't get to use the computer last night thoguh
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
» Goto page 1, 2, 3 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 1 of 3
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement