KermMartian wrote:
I see a place where DS and IS could be used, too.
IS and DS is tricky though, using in certain situations will cause wierd and random bugs...
Here's my code, Im testing your's now
BASIC Code wrote:
:"? 8 8 8 8 ?? 7 8 8 ?? 8 8 ?? 8 ?? 8 ?? 8 ?? ?? 8 ?? ?? ?? oo ?? ?? ?[Box][Box]? ?? ??----------------------------------------------------??Str1
:ClrHome
:0?I
:24?K
:While K?45
:I+(K=26 and I?38?I
:If K=24 or K=26
:Output(1,1,sub(Str1,1+I,16)+sub(Str1,55+I,16)+sub(Str1,109+I,16)+sub(Str1,163+I,16)+sub(Str1,217+I,16)+sub(Str1,271+I,16)+sub(Str1,325+I,16)+sub(Str1,379+I,16
:getKey?K
:End
:DelVar Str1
:ClrHome
:Output(1,
Generated by
SourceCoder, © 2005
Cemetech
EDIT:
===
your's runs about the same speed as mine, but then after 8 screens I get an Err:Invalid Dim
Code: :ClrHome
:"
:For(A,1,15
:Ans+" Str2
:End
:While 1
:For(A,1,8
:Output(A,2,sub(Str2,15A-14,15
:End
:"
:For(A,1,8
:Ans+sub(Str2,15A-13,14)+sub(" O",1+not(randInt(0,3)),1
:End
:sub(Ans,2,length(Ans)-1Str2
:End
Any suggested optimizations? It runs too slowly for my liking.
Edit: Sourcecoder didn't parse the :End on the last line. I had to add it manually.
wow sourcecoder screwed mine up....
ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik ik
:'''(
If you look at my code, the string is stored in the format that it is displayed in. You guys have your strings format in a more human-readable format - the first 8 characters are the first column, the next 8 the 2nd, and so on. The problem with that is that it will take much longer to render a frame, because you must use a For loop (or brute force) to properly separate the string into columns and then display them. In contrast, my "engine" keeps the string stored in the format it will be displayed in. That way, all I need is one output call to display the entire thing instantaneously. The downside to this is that there is more lag time between frames because I must do more chopping up of the string to get the next row in.
In my opinion, this is better than your approach because 1)there is no visual lag, 2)it is slightly faster overall because there are fewer total substr operations, and the ones I do have are much simpler, 3)it is just as easy to enter the next column because it accepts a human-readable format, and 4)mine will not crash unless you enter a string that is less than 8 characters for the next column, as opposed to yours, which will crash (though I don't know why).
I could speed mine up a bit by getting rid of the For loop that inserts the next column and uses brute force instead. This probably makes sense since the reason I used a For loop was to make it adaptable to the graphscreen, though now that I think about it, it would be far, far too slow on the graphscreen and not worth attempting.
Yeah, forget trying to do this on the graphscreen. That's one place where I would recommend an ASM lib.
I like my format better because I can still use on output command, and it seems faster....btw I got a guy added now so it can run around
K, are you gonna release it at ticalc.org?
yeah, I will, but Im gonna make a good game to go with it first.
Sounds good. You are gonna release it as a kit though, right?
yeah Im going to. We need to spark more development in the advanced Basic community
Definitely. It's getting pretty depressing...
Guess the Number version 0.001 beta.....
Teh Best Quadratic Solver.....
I know what you mean
elfprince13 wrote:
yeah Im going to. We need to spark more development in the advanced Basic community
That's what B1337 is for. Speaking of which, I think I'm going to move the topic there.
ah, but when was the last time someone joined? we need to get more n00bs interested in furthering their skills beyond
Code: Disp "Hello World"
Prompt Str1
Disp "Thats cool good bye"
AGH! Lowercase!! diediedie /me defenestrates lowercase.
Jonathan_Pezzino wrote:
elfprince13 wrote:
yeah Im going to. We need to spark more development in the advanced Basic community
That's what B1337 is for. Speaking of which, I think I'm going to move the topic there.
If you do that, can you give me membership? I would like to continue to post in this topic.