 |
kallamadia Newbie
Joined: 07 Aug 2006 Posts: 3 Location: michigan
|
Posted: Mon Aug 07, 2006 3:56 am
Deck of cards |
currently I am in possession on my Mud of a deck of cards.
Each cards name is "a card" to reduce cheating. when you look at it the long description of the card tells you what card it is. HOWEVER. at this moment I don't have a "shuffle" as far as I know.. the previous person who had a deck of cards was able to program a shuffle. however I'm not programming saavy and would like to know where or how I can create a "random" shuffle to reduce cheating on any half. I want to have fun and also not be thought that I am cheating. Someone happen to know how I could do all this? |
|
|
 |
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Mon Aug 07, 2006 2:30 pm |
Post here how you manipulate the cards in the deck and someone might be able to help you. Shuffler would work based on %rand with the card names and how many cards there are.
|
|
|
 |
kallamadia Newbie
Joined: 07 Aug 2006 Posts: 3 Location: michigan
|
Posted: Wed Aug 09, 2006 3:51 am |
Maniplate the cards??? no idea... heh
the cards names will ALL be "A card" as the item name the DESCRIPTION of the items will all tell what card it is when you "look card" there are 54 cards (52 normal cards and 2 jokers) |
|
|
 |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Wed Aug 09, 2006 8:41 am |
What we'd need to know is what you'd have to type if you wanted to shuffle the dec manually.
For example, on my mud then to tell the difference between a number of similar items (cards) then I'd need to check the id numbers of the items I'm currently holding, using 'id inv'
I'd then see something like
a card (100056)
a card (100057)
a card (100058)
a card (100059)
a card (100060)
I would then probably %push (add) each card number to a list and then to shuffle the deck I'd need to %pop (remove) a random card from that list, using something like 'deal %pop(@cardList, %random(@cardList, %len(@cardList)))'
I don't have zmud on this computer so the syntax is probably not right but the principle should be sound
So first you need a way of tracking all the cards
Then you need to pick a random card and do what you want with it (deal for example)
Hope that gets you started |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
 |
kallamadia Newbie
Joined: 07 Aug 2006 Posts: 3 Location: michigan
|
Posted: Thu Aug 10, 2006 3:29 pm |
To take a card out of the deck (no matter where the place in it) It would be
1.card
7.card
14.card
54.card
24.card
Thanks for the help... |
|
|
 |
|
|