[xLIB] Help with matricies.

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
sean77771
New Member
Posts: 5
Joined: Sat 11 Feb, 2006 9:07 pm

[xLIB] Help with matricies.

Post by sean77771 »

Ok, I read through the readme and I understand how to use the commands that xLib lets you use. The only thing I don't understand is how to make the matricies. I looked at the MAP1 program that draws the matricies for the example program, but it just looks like a bunch of numbers to me. Could someone help me, or point me in the direction of someone who can? Thanks.
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
So you just want to change a number, then just [A](A,B
such as I want a 3 to be in the 1,1 position then I would 3->[A](1,1


Btw tr1p, you might want to move this to the help section.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

You can Edit a matrice using the on calc editor. Just press 2nd then x^-1 (Matrix) to get to the menu. Here you can view, create and edit any matrice on your calc.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
sean77771
New Member
Posts: 5
Joined: Sat 11 Feb, 2006 9:07 pm

Post by sean77771 »

Thanks, but I'm not sure that you guys understand my question. When I say I don't understand the matricies, I mean I REALLY don't understand them. What are all those numbers? How are those used to draw the map?
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

A matrix is a way to store numbers in a 2 dimensional way. So instead of having an index, like in a list, you'd have two coordinates to point to a value. This is an example of a matrix:

Code: Select all

3 6 1 9 6 4
3 8 3 7 3 5
8 2 9 1 3 4
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
sean77771
New Member
Posts: 5
Joined: Sat 11 Feb, 2006 9:07 pm

Post by sean77771 »

And then the number in that spot corresponds to the number of the tile in the pic?
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Yes, the tiles are 8x8 (well then theres 12x12) and the number from left to right top to bottom (0|1|2|3|4|5|6|7|8|9|10|11 then a new row starts with 12.)
sean77771
New Member
Posts: 5
Joined: Sat 11 Feb, 2006 9:07 pm

Post by sean77771 »

Great thanks for your help.
Post Reply