Make a new program, and do this
:" "-->Str1
:For(N,1,7
:Str1 + Str1 -->Str1
:End

This should generate a 8x16 blank map

Then, go to the first line of the maze program, and hit [2nd] [RCL] and then find String1 to recall Str1 into your program. Then, enter "-->Str1" to have this stored to String1. Basically you'll have


Code:
:"    (a huge string)    " -->Str1

as your first line. Now, add a "*" anywhere in this string. Those "*"'s will compose your walls... comprende?
rthprog wrote:
Make a new program, and do this
:" "-->Str1
:For(N,1,7
:Str1 + Str1 -->Str1
:End

This should generate a 8x16 blank map

Then, go to the first line of the maze program, and hit [2<sup>nd</sup>] [RCL] and then find String1 to recall Str1 into your program. Then, enter "-->Str1" to have this stored to String1. Basically you'll have


Code:
:"    (a huge string)    " -->Str1

as your first line. Now, add a "*" anywhere in this string. Those "*"'s will compose your walls... comprende?


Its not working.
I worked on some stuff, and here is what I have so far. The only thing I need to do is work on the actual maze part, which will be Str1. 360 characters right? I just need to find some graph paper.



Code:
"___" -> str1
:1→A
:2→P:2→Q
:While 1
:For(B,1,8
:Output(B,1,sub(Str1,A+24B-24,16   
:End
:Output(P,Q,“O"   
:Repeat Z
:getKey→Z
:P+(sub(Str1,A+24P+Q-1,1)ø“/”)(Aù169)(Z=34)-(sub(Str1,A+24P+Q-49,1)ø“/”)(A÷24)(Z=25→P
:Q+(sub(Str1,A+24P+Q-24,1)ø“/”)(0=fPart((A-9)/24))(Z=26)-(sub(Str1,A+24P+Q-26,1)ø“/”)(0=fPart((A-1)/24))(Z=24→Q
:A+(sub(Str1,A+24P+Q-24,1)ø“/”)(0øfPart((A-9)/24))(Z=26)-(sub(Str1,A+24P+Q-26,1)ø“/”)(0øfPart((A-1)/24))(Z=24)+24(sub(Str1,A+24P+Q-1,1)ø“/”)(A<169)(Z=34)-24(sub(Str1,A+24P+Q-49,1)ø“/”)(A>24)(Z=25→A
:End   
:End   


Since I'm still new, I don't really know if this will work. Can anybody help me out since rthprog is gone?
you have wierd characters in your code; I can't see what you're trying to do...

Anyways, you need a "End" after getkey, not two at the end...

Also, what's with the 24? Are you planning on making this a scrolling map? Also, you won't have 360 characters if your map is static (as in it dosent scroll around). It would be 8x16, so 128 characters. Finally, what do you need graphpaper for?

Could you just give me the dimensions of the map you plan to use? will it 8x16 (the entire screen), or greater than that? I'm just kinda confused... Question
Swoll_Monkey wrote:
rthprog wrote:
Make a new program, and do this
:" "-->Str1
:For(N,1,7
:Str1 + Str1 -->Str1
:End

This should generate a 8x16 blank map

Then, go to the first line of the maze program, and hit [2<sup>nd</sup>] [RCL] and then find String1 to recall Str1 into your program. Then, enter "-->Str1" to have this stored to String1. Basically you'll have


Code:
:"    (a huge string)    " -->Str1

as your first line. Now, add a "*" anywhere in this string. Those "*"'s will compose your walls... comprende?


Its not working.



ok, make a new program

Code:
:" "-->Str1
:For(N,1,7
:Str1 + Str1 -->Str1
:End


For now, the maze code will run with a blank map.
To add walls, Recall String 1 into the first line of the maze code, and store it to String 1. Add asterisks wherever you want; these will serve as walls.

Thus, your code should end up as


Code:
:"      (very long string with random "*"'s)    " -->Str1
:ClrHome
:1->X
:1->Y
:While 1
:Output(Y,X,”O”
:Repeat Ans
:GetKey
:End
:Ans->A
:Output(Y,X,” “
:(A = 34) – (A =25) + Y ->Y
:(A = 26) – ( A = 24) + X -> X
:8(Y= 0) – 8 (Y = 9) + Y ->Y
:16(X = 0) – 16(X = 17) + X ->X
:If sub(Str1,8(Y-1) + X,1) = "*"
:Then
:\\ you could put a menu/goto here if you want to take them back to a main menu or display some message, etc...
:1-> X
:1->Y
:End
:End
rthprog wrote:
you have wierd characters in your code; I can't see what you're trying to do...

Anyways, you need a "End" after getkey, not two at the end...

Also, what's with the 24? Are you planning on making this a scrolling map? Also, you won't have 360 characters if your map is static (as in it dosent scroll around). It would be 8x16, so 128 characters. Finally, what do you need graphpaper for?

Could you just give me the dimensions of the map you plan to use? will it 8x16 (the entire screen), or greater than that? I'm just kinda confused... Question


I planed on it being 24x15. Because having a maze that's 16x8 is too easy to finish. I need graphpaper to chart out where my maze will be.
aah =D Just out of curiosity, why did you choose 15 rather than 16? (Are you like planning to add a scroll bar-esque indicator? =D)

well I'll leave you to code... (I kinda have to go now... Sad )
You need an "End" after "getkey"? Since when?

Is there a memory leak I never knew about or something?
jbr wrote:
You need an "End" after "getkey"? Since when?

Is there a memory leak I never knew about or something?


He had

Code:
:While 1
:Repeat Var
:getKey-->Var
:Code
:End
:End

which certainly works, but I don't think thats what he meant =D I mean, he'll be doing a lot of unnecesary calculations that way...
  
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 2 of 2
» 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

 

Advertisement