document.write('<div class="vbnet" style="font-family: monospace;"><br />');
document.write('<span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">Class</span> card<br />');
document.write('<br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'Cory Jackson</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'while not all properties are used, they provide a use for other games</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'i have taken into consideration all properties of a card i could think of</span><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'stores&nbsp; if red then true</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> m_red <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Boolean</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">ReadOnly</span> <span style="color: #FF8000;">Property</span> <span style="color: #0600FF;">red</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return m_red<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Property</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'holds string for picture file name</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> m_picture <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">ReadOnly</span> <span style="color: #FF8000;">Property</span> picture<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return m_picture<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Property</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'suit holds string value of suit</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> m_suit <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">ReadOnly</span> <span style="color: #FF8000;">Property</span> suit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return m_suit<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Property</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'number holds card value of card</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> m_cardvalue <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">ReadOnly</span> <span style="color: #FF8000;">Property</span> cardvalue<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return m_cardvalue<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Property</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> m_cardname <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">ReadOnly</span> <span style="color: #FF8000;">Property</span> cardname<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return m_cardname<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Property</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'returns the string value of card</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> m_facecard <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Boolean</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">ReadOnly</span> <span style="color: #FF8000;">Property</span> facecard<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Return m_facecard<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Get</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Property</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'creates a card, gets card number and suit from deckofcards class</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">Sub</span> <span style="color: #FF8000;">New</span><span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> fromdecknumber <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span>, <span style="color: #FF8000;">ByVal</span> fromdecksuit <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> suits<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> = <span style="color: #000000;">&#123;</span><span style="color: #808080;">&quot;hearts&quot;</span>, <span style="color: #808080;">&quot;diamonds&quot;</span>, <span style="color: #808080;">&quot;clubs&quot;</span>, <span style="color: #808080;">&quot;spades&quot;</span><span style="color: #000000;">&#125;</span><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; m_cardvalue = fromdecknumber<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; m_suit = suits<span style="color: #000000;">&#40;</span>fromdecksuit<span style="color: #000000;">&#41;</span><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> <span style="color: #000000;">&#40;</span>m_suit = <span style="color: #808080;">&quot;diamonds&quot;</span><span style="color: #000000;">&#41;</span> Or <span style="color: #000000;">&#40;</span>m_suit = <span style="color: #808080;">&quot;hearts&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Then</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_red = <span style="color: #0600FF;">True</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>fromdecknumber = <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> Or <span style="color: #000000;">&#40;</span>fromdecknumber = <span style="color: #FF0000;">11</span><span style="color: #000000;">&#41;</span> Or <span style="color: #000000;">&#40;</span>fromdecknumber = <span style="color: #FF0000;">12</span><span style="color: #000000;">&#41;</span> Or <span style="color: #000000;">&#40;</span>fromdecknumber = <span style="color: #FF0000;">13</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Then</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_facecard = <span style="color: #0600FF;">True</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Select</span> <span style="color: #0600FF;">Case</span> fromdecknumber<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #FF0000;">1</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardname = <span style="color: #808080;">&quot;Ace of &quot;</span> &amp; m_suit<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardvalue = <span style="color: #FF0000;">1</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_picture = m_suit &amp; <span style="color: #808080;">&quot;_ace.png&quot;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #FF8000;">Is</span> &lt;= <span style="color: #FF0000;">10</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardname = fromdecknumber &amp; <span style="color: #808080;">&quot; of &quot;</span> &amp; m_suit<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardvalue = fromdecknumber<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_picture = m_suit &amp; <span style="color: #808080;">&quot;_&quot;</span> &amp; fromdecknumber &amp; <span style="color: #808080;">&quot;.png&quot;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #FF0000;">11</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardname = <span style="color: #808080;">&quot;Jack of &quot;</span> &amp; m_suit<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardvalue = <span style="color: #FF0000;">10</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_picture = m_suit &amp; <span style="color: #808080;">&quot;_jack.png&quot;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #FF0000;">12</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardname = <span style="color: #808080;">&quot;Queen of &quot;</span> &amp; m_suit<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardvalue = <span style="color: #FF0000;">10</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_picture = m_suit &amp; <span style="color: #808080;">&quot;_queen.png&quot;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Case</span> <span style="color: #FF0000;">13</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardname = <span style="color: #808080;">&quot;King of &quot;</span> &amp; m_suit<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_cardvalue = <span style="color: #FF0000;">10</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_picture = m_suit &amp; <span style="color: #808080;">&quot;_king.png&quot;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Select</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />');
document.write('<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Class</span><br />');
document.write('&nbsp;</div><div class="vbnet" style="font-family: monospace;"><br />');
document.write('<span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">Class</span> deckofcards<br />');
document.write('<br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'Cory Jackson</span><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'sets an array of 52 cards</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> m_deck<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">52</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> card<br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'constructor makes 52 cards, or 1 complete deck of cards</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'passes the card number and suit to the card class and fills the array</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">Sub</span> <span style="color: #FF8000;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> temp1, temp2 <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> suits<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> = <span style="color: #000000;">&#123;</span><span style="color: #808080;">&quot;Hearts&quot;</span>, <span style="color: #808080;">&quot;Diamonds&quot;</span>, <span style="color: #808080;">&quot;Clubs&quot;</span>, <span style="color: #808080;">&quot;Spades&quot;</span><span style="color: #000000;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">For</span> temp1 = <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">To</span> <span style="color: #FF0000;">3</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">For</span> temp2 = <span style="color: #FF0000;">1</span> <span style="color: #FF8000;">To</span> <span style="color: #FF0000;">13</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_deck<span style="color: #000000;">&#40;</span>temp1 * <span style="color: #FF0000;">13</span> + temp2<span style="color: #000000;">&#41;</span> = <span style="color: #FF8000;">New</span> card<span style="color: #000000;">&#40;</span>temp2, temp1<span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Next</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Next</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'swaps card and temp card</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> swap<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> shuffletemp1 <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span>, <span style="color: #FF8000;">ByVal</span> shuffletemp2 <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> tempcard <span style="color: #FF8000;">As</span> card<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; tempcard = m_deck<span style="color: #000000;">&#40;</span>shuffletemp1<span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; m_deck<span style="color: #000000;">&#40;</span>shuffletemp1<span style="color: #000000;">&#41;</span> = m_deck<span style="color: #000000;">&#40;</span>shuffletemp2<span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; m_deck<span style="color: #000000;">&#40;</span>shuffletemp2<span style="color: #000000;">&#41;</span> = tempcard<br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">\'shuffles cards randomly</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">Sub</span> shuffledeck<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> index, shuffletemp1, shuffletemp2 <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> randomnum <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> Random<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">For</span> shuffletemp1 = <span style="color: #FF0000;">1</span> <span style="color: #FF8000;">To</span> <span style="color: #FF0000;">2000</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">For</span> shuffletemp2 = <span style="color: #FF0000;">1</span> <span style="color: #FF8000;">To</span> <span style="color: #FF0000;">52</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index = randomnum.<span style="color: #FF8000;">Next</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">1</span>, <span style="color: #FF0000;">53</span><span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; swap<span style="color: #000000;">&#40;</span>shuffletemp2, index<span style="color: #000000;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Next</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Next</span><br />');
document.write('&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />');
document.write('<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Class</span><br />');
document.write('&nbsp;</div>');
document.write('');
document.write('I have used this set in a few different projects and I have not had any problems. Leave a comment if you have any ideas for improvement. ');
document.write('<br />&nbsp;<br /><div style="font-size: 12px">Brought to you by the community at <a href="http://www.bytemycode.com/snippets/snippet/344/1/" target="_blank">byteMyCode</a>.</div>');
