Re: Need Help using GLib -> GList



Tristan Van Berkom wrote:

Hmmm,
    I think this is what they call "deja vu" ;-)


I accidentally posted twice.  Sorry

Regardless I did as you suggested and in fact the code simplified greatly. I am learning to use the GList and making lists of lists, which is very handy. I am implementing a simulation of the old card game "War". It handles arbitrary number of players (a list) holding a hand of cards (each hand a list). The deck of cards is a list of pointers of type "card" that is a structure of values and suits. The entire game is a process of moving pointers to the cards around.

It is not done yet, but my purpose is to just learn to use structures, pointers, and lists. I have to work on it in between other stuff, but its fun to do. Eventually it will gather statistics on how long games last. (Inspired by a long game I played with my 6 year old nephew) I am not done yet, but when I get there, it might be a good tutorial for others. (Not that anyone is interested in such things ;)

Thanks for your help,

Jerry



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]