Author |
Message |
methodman
|
Posted: Mon Jan 06, 2003 4:58 pm Post subject: *[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 |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Tony

|
|
|
|
 |
methodman
|
Posted: Mon Jan 06, 2003 5:34 pm Post subject: (No subject) |
|
|
The program must be using link list (with pointers, records, ect..), not arrays. |
|
|
|
|
 |
methodman
|
Posted: Mon Jan 06, 2003 5:45 pm Post subject: (No subject) |
|
|
can you modify what you wrote in the last post to use an array?? thnx |
|
|
|
|
 |
Tony

|
|
|
|
 |
Tony

|
Posted: Mon Jan 06, 2003 5:53 pm Post subject: (No subject) |
|
|
sure thing
code: | 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) <-card #1
.row <-located in this row
.column <-this column
.ID <- and contains this face value
I hope this clears things up in a way. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
methodman
|
Posted: Tue Jan 07, 2003 2:52 am Post subject: (No subject) |
|
|
cool thanks buddy.. this site is way better than all former turing sites
do you have any idea of how to use pointers?? like a pointer to store what cards are in a coulmn.. and another pointer that each card has telling where in the 3 columns it is?
i'll be getting the new project sheet tomorrow so i'll have a better of what to do ..do you have msn or icq?? |
|
|
|
|
 |
Tony

|
Posted: Tue Jan 07, 2003 3:00 am Post subject: (No subject) |
|
|
MSN if you want... go look in my profile for address.
I'm not sure on the use of pointers. Hopefully someone else can answer that question. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
Sponsor Sponsor

|
|
 |
|