# Draw a random card from a player hand

**URL:** <https://forum.vassalengine.org/t/draw-a-random-card-from-a-player-hand/11390>\
**Category:** Module Design\
**Created:** [November 27, 2020, 10:30am UTC](https://forum.vassalengine.org/t/draw-a-random-card-from-a-player-hand/11390 "2020-11-27T10:30:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fw190d11](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/f/838e76/32.png) [@fw190d11](https://forum.vassalengine.org/u/fw190d11)\
**Post date:** [November 27, 2020, 10:30am UTC](https://forum.vassalengine.org/t/draw-a-random-card-from-a-player-hand/11390/1 "2020-11-27T10:30:12Z")

</div>

Hi guys,  
Was wondering if someone could point me in the right direction to be able to have a random card discarded from a players hand.  
Thanks,  
Dave B

---

<div class="post-metadata">

**Author:** ![marktb1961](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/marktb1961/32/231_2.png) [@marktb1961](https://forum.vassalengine.org/u/marktb1961)\
**Post date:** [November 27, 2020, 11:14am UTC](https://forum.vassalengine.org/t/draw-a-random-card-from-a-player-hand/11390/2 "2020-11-27T11:14:41Z")

</div>

One method is to send all cards in the hand window to an empty draw pile (which could be defined in the hand-window, perhaps offset from the visible area); send one card from there to the discard location and then send the remainder back to the original hand location.

You will find an example in the Commands & Colors Napoleonics module. Look in the Allies or French private windows. You will see a multi-action button (“discard 1 card for square” or some such name) that strings together the automation. Cards to be discarded in this way have the Send To deck and Send To Location traits required to perform the individual actions.

---

<div class="post-metadata">

**Author:** ![fw190d11](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/f/838e76/32.png) [@fw190d11](https://forum.vassalengine.org/u/fw190d11)\
**Post date:** [November 27, 2020, 4:25pm UTC](https://forum.vassalengine.org/t/draw-a-random-card-from-a-player-hand/11390/3 "2020-11-27T16:25:07Z")

</div>

Will do.  
Thanks

---

<div class="post-metadata">

**Author:** ![fw190d11](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/f/838e76/32.png) [@fw190d11](https://forum.vassalengine.org/u/fw190d11)\
**Post date:** [November 28, 2020, 8:38am UTC](https://forum.vassalengine.org/t/draw-a-random-card-from-a-player-hand/11390/4 "2020-11-28T08:38:44Z")

</div>

Got it.  
thank you very much, this will work fine.
