Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
kallamadia
Newbie


Joined: 07 Aug 2006
Posts: 3
Location: michigan

PostPosted: 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?
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: 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.
Reply with quote
kallamadia
Newbie


Joined: 07 Aug 2006
Posts: 3
Location: michigan

PostPosted: 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)
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: 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... ;)
Reply with quote
kallamadia
Newbie


Joined: 07 Aug 2006
Posts: 3
Location: michigan

PostPosted: 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...
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net