
-----------------------------------
methodman
Mon Jan 06, 2003 4:58 pm

*[URGENT]* Program Using Link List [Question]
-----------------------------------
Hey,

I need to make a turing card game. How do I display 15 random cards (from a full deck of cards) in 3 columns (5 cards per column) and link them all together. So there would have to be two points, 1 that stores what column the card is in and another to store where the card is in the 3 columns (such as position 1,1 for the first card and 1,2 for the second card in the first column). How do I do this??

Thanks,

methodman

-----------------------------------
Tony
Mon Jan 06, 2003 5:24 pm


-----------------------------------
you'd need to use multidimentional array, also known as MATRIX.

you can use our search feature to find posts about topics that are already created.

Here's a good result - http://danco.no-ip.com/turing/viewtopic.php?t=225&highlight=array

Post if you need aditional info.

-----------------------------------
methodman
Mon Jan 06, 2003 5:34 pm


-----------------------------------
The program must be using link list (with pointers, records, ect..), not arrays.

-----------------------------------
methodman
Mon Jan 06, 2003 5:45 pm


-----------------------------------
can you modify what you wrote in the last post to use an array?? thnx

-----------------------------------
Tony
Mon Jan 06, 2003 5:47 pm


-----------------------------------
I'm not exactly sure on how you're going to pull this off without arrays...

anyway, maybe you need something like this?

var card :
            record
                row : int
                column : int
                ID : int
            end record

this way you can have
card.row to store row where card is located
card.column to store column where card is located
card.ID to store card value that you're dealing with.

I still think you'd need an array of var card to have 15 cards instead of 1...

Maybe I'm not understanding your question?  :?

-----------------------------------
Tony
Mon Jan 06, 2003 5:53 pm


-----------------------------------
sure thing

var card : array 1..15 of
            record 
                row : int 
                column : int 
                ID : int 
            end record

this way you can access each card using following:

card(1) 