I was going to write a Tetris type game, and I figured I would begin by writing an actual Tetris game (to learn the ropes as it were). Anyway I know I could use arrays to strore the board or pit. But I figured that maybe linked lists would be a good alternative because I could easily remove a line from the list (providing each item in the list was a line on the board), and it would be easy to add new empty lines to the top of the pit/board.
How would I represent a line in each item in the list? I thought of using a binary representation. Is this a good idea. Can anyone help? I'd be grateful
I'd also like to know if there is a way you can directly reference an arbitray item in a list (like in an array), by number. e.g. list(10)., without having to cycle through the list. I thought of using an array of pointers to each item in the list, but I was wondering if there is a less-fudged way of doing it. Thank you very much :)
Rico
How would I represent a line in each item in the list? I thought of using a binary representation. Is this a good idea. Can anyone help? I'd be grateful
I'd also like to know if there is a way you can directly reference an arbitray item in a list (like in an array), by number. e.g. list(10)., without having to cycle through the list. I thought of using an array of pointers to each item in the list, but I was wondering if there is a less-fudged way of doing it. Thank you very much :)
Rico