Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Path with integers

From: allenk:powerup:au at: 8-Dec-2000 20:09

Hi Giovanni, If you decompress the cards.bin that I use for all my card games you will see it is the following format. You don't need to use num within the block because you can use the card's index position to access them. card: make object! [rank: 0 suit: none image: none] cards: reduce [ make card [ rank: 1 suit: 'Clubs image: load to-binary decompress 64#{....} ] .....etc...etc .... make card [ rank: 13 suit: 'Spades image: load to-binary decompress 64#{....} ] ] If you could work with the same format, then people can choose to use whatever card pack they choose. I'd really like to get a set with Cups and Swords etc. cards/1/rank ==1 cards/52/rank ==13 In my system, the cards block is a look up table, Card objects aren't stored anywhere else. All piles in the layout maintain a contents list with the index numbers of the cards they contain. Saves a lot of memory. If you would like to use my card game engine, let me know and I'll give you intructions, it only needs a rule object to be created, and voila you have a new card game complete with drag & drop, destination testing and scoring. Penguin, Castle and Roman all use this engine. Cheers, Allen K