Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
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.
Cool. I could never figure out how to make one of those work. Is it for graph- or home- screen?
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?
precisely, and then I use Output( to display it all
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:
[Code goes here]
Smaller, yes.You could also (although this would be overly slow) do something like:
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.
Can you post it? I would like to see it.
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.
Ah, very nice use of sub!
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.
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).
I assume SourceCoder could find no optimizations? Smile
Of course it could (there are some unnecessary quotes), but I am a TI-BASIC god and thus beyond any sort of "optimizing."
I see a place where DS and IS could be used, too. Smile
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 Sad
How fast does it run in comparison to my code?
I haven't tried yet, but my code with very slight modifications could even be used in a 4-directional scroller Smile Sonic in Basic would be awesome....
  
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
Page 1 of 3
» All times are GMT - 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

 

Advertisement