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



----- Original Message -----
From: "Giovanni Cardona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 08, 2000 8:28 AM
Subject: [REBOL] Path with integers


> REBOL [ Title: "Path tests for a card game"
>  Author: "[EMAIL PROTECTED]"
>  Comments: {
>  As a programmer i know this is not
>  a pretty way to accomplish this, but
>  i was toying around with the path
>  possibilities of rebol, and i wonder
>  if using integers as path is possible
>  in rebol. Im just starting using Rebol
>  and I think it rocks!
>  }
>       ]
>
> ;The deck have 40 cards.  An individual image path will be added later
>
> cards: [
>  1 [
>    type gold
>    value 11
>    num 1
>    ]
>  2 [
>    type gold
>    value 0
>    num 2
>    ]
>  3 [
>    type gold
>    value 10
>    num 3
>    ]
>  4 [
>    type gold
>    value 0
>    num 4
>    ]
>  5 [
>    type gold
>    value 0
>    num 5
>    ]
>  6 [
>    type gold
>    value 0
>    num 6
>    ]
>  7 [
>    type gold
>    value 0
>    num 7
>    ]
>  8 [
>    type gold
>    value 2
>    num 10
>    ]
>  9 [
>    type gold
>    value 3
>    num 11
>    ]
>  10[
>    type gold
>    value 4
>    num 12
>     ]
>     11[
>    type cups
>    value 11
>    num 1
>     ]
>  ]
>
>
> print cards/10/type ; This prints OK
> print cards/11/type ; Integer in path detected!
> print cards/9/type
>
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to