BASIC soft-coded map

A General Discussion forum for TI calculators

Moderator: MaxCoderz Staff

Post Reply
FaveRave09
New Member
Posts: 13
Joined: Tue 29 Nov, 2005 8:10 pm

BASIC soft-coded map

Post by FaveRave09 »

Does anyone have a reliable and fast way to create a soft-coded (doesn't use any BASIC variables) map for an RPG? It can easily be done with matricies and such, but I have no idea how to do it otherwise :? .
Welcome to Jamdung, poor people are dead at random, political violence caan done.
-Damian Marley
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

Is this for HomeScreen or GraphScreen?

Matrices work really well for HomeScreen, just use a 8x16 matrix that stores a number for each square. Then run a for loop that has if statements that tell the calc which ASCII character to draw for the number in matrix.

I heard you could use strings as well, but I don't remember how you do that.
Image Image Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

For matrics:
BASIC Code wrote::ClrHome
:[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1][1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1Image[A]
:For(A,1,8
:For(B,1,16
:Output(A,B,sub(" O",[A](A,B)+1,1
:End
:End
:2ImageA:2ImageB
:[A](A,B
:Repeat Ans=1
:Repeat Ans
:getKeyImageImage
:End
:AImageC:BImageD
:B+(Image=26)-(Image=24ImageB
:A+(Image=34)-(Image=25ImageA
:If [A](A,B:Then
:CImageA:DImageB:End
:Output(C,D,"
:Output(A,B,"O
For strings that are scrollable:
BASIC Code wrote:::"MAZES
:DelVar W:prgmLEVEL
:Lbl 1:Repeat X-87Image4:Output(1,1,sub(Str1,X-87,128:Output(6,8,"*
:XImageY:Repeat Ans:getKeyImageImage:End:X+(Image=26)-(Image=24ImageX:X+16((Image=34)-(Image=25ImageX:If sub(Str1,X,1)="O
:YImageX:End:W+1ImageW:prgmLEVEL:
BASIC Code wrote::If W=4:Then:For(W,1,8:For(X,1,16:Output(W,X,"
:End:End:For(W,1,8:For(X,1,16:Output(W,X,"O
:End:End:For(W,1,8:For(X,1,16:Output(W,X,"
:End:End:Output(4,1,"THE-------------
:Output(5,1,"-------------End
:Output(8,1,"By Kalan
:Stop:End
:If W=3
:"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOEOOOOOOO OOOOOOO O O OOOOO OOOO O OOOOO O O OOO O-O OO O O O-OO OOOOOOO O O-O O O O O-O OO OOOO O O O-O O O OO-OOOOOO OOOOO OO-O O O-O O O OOOOOO O-OO O O OO O-O OOOOO O O O-O OO O O O O-O O O O-O OOOOOOOOO OOO-OOO OO O OOO O OOO O OO OO OOO OO OOO O O OO OO OOOO OO O O O OOOOO OO OO O O OO O O OO O OO OOOO O O O OO OO OO O OOOOO OO O OOO OO O OOO OOO O OOOO OOO O OOO OOOOOOOO OOOOOO O O OOOO OOOO O O O O O OOO O O OOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOImageStr1
:If W=2
:"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO4OOOOOO O O O OOOO O OOOO O O O O OO OO O O O OO OOO O O O OOO O O O OOOOOO O O O OO OOO OOOOOO O O OOOOOO O OOO O O O OO OOOOO OO OOOO O OO O OOOOOO OOO O O OOOOOO OOOOOOOO OOO OOO O O OO OO OO O O O OOOOOOO O O O O O O O O O O OOO O O O O O O O O OO OO O O O O O OO O O OO OOOOOOO O O O OOO OO OOO OOOO OOO OO OO O O O O O O OOOOOOOO O O O O O OOOOOO O O O O O OOO OO OO OO O O O O OO OOOOOOOO OO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOImageStr1
:If W=1
:"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO3OOOOO O O O OO OOOO O O OO O OO O OO OO OO O O O OO O OOOO O O O OO OO OO O OOO OO OOO OO OO OOO O OOOO OOOO O OOOOO O OOO O O OO OO O O OO O O O OO OO O OOO O O O OOOO OOOOOO OO OO OOO OOO O O OOO OO OO OO O O OOOOOOO O O OOOO OO O OOOOO O OOOOO OOO OO O O O O O O O OO OO OOO OOOO O O O OOOO O O OOOO O O O OOOOO O O OOO OOO O OO O O OO OOOOOOOO O O O OOOOOOO O O OOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOImageStr1
:If W=0
:"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO2OOOOOOOOO OO OO O OOO O OOO OOOO O O O O OO O O O OOOO O O OO OO OO OO O O OOO O OO O OOOO O OO OOO O O O O OO O OOOOOO O OOO OOOOOOOOOO OO O O O OOOOO O OO O O O O OOO O OOOO OOO O O OO O O OOOO O OOO O O O O OO OOO OOO OOOOOOOOOO O OOOOOOOOO O OOO O O O O O O O O O O OOOOOO OOO O O OOO OOOOOO OO O O O O O OO O OOO OOOO O OOO OO O OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOImageStr1
:length(Str1)-47
This isn't optimized so w/e.
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

Which is faster, updating the entire matrix and storing it into the matrix variable? or trying to store a new value into an element of the matrix?
Image Image Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

calcul831415 wrote:Which is faster, updating the entire matrix and storing it into the matrix variable? or trying to store a new value into an element of the matrix?
New value into an element would be faster and smaller.
User avatar
KermMartian
Calc Wizard
Posts: 549
Joined: Tue 05 Jul, 2005 11:28 pm
Contact:

Post by KermMartian »

Updating elements is much, much, much better.
Image Image Image
FaveRave09
New Member
Posts: 13
Joined: Tue 29 Nov, 2005 8:10 pm

Post by FaveRave09 »

I'll repeat it. DOESN"T USE BASIC VARIABLES. Using "Ans" is ok. Any ideas now?.
Welcome to Jamdung, poor people are dead at random, political violence caan done.
-Damian Marley
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

That would require a lot of workarounds and would probably be slower.
Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

threefingeredguy wrote:That would require a lot of workarounds and would probably be slower.
Yeah it would be quicker to aleast use 2 varibles, or if you wish not to use A-Theata then you could use list?
Post Reply