python uno.py
python3 uno.py
Make a new XML file with deck as root tag
<?xml version="1.0" encoding="UTF-8"?>
<deck>
</deck>Then add any of the following tags, they are described as follows
<color id="X" name="Y"/>defines a color in which you can put the following XML tags inside, X is the id of the color and Y is the name of the color, but the name of the color isn't used to compare if a card is playable or not while the id of the color is
<card id="X"/>defines a card with no actions/custom actions with X being the id of the card
<scard id="X" type="Y"/>defines a card with special actions but no custom actions, such as skip, draw, reverse, wild draw, and wild with X being the id of the card, and with Y being the type of action the card performs
<ccard id="X" ssc="Y" csc="Z">OPTIONAL</ccard>defines a card with custom actions, the code to define custom actions is written in python with X being the id of the card, Y being the code ran on the server side, and Z being the code run on the client side, all attributes are required, inner text is optional as it is the card's description
The entity tags are used for default cards, it is recommended that you add custom cards under another entity so you can shorten the XML file if each color has the same cards, the following is a short example of using vs not using XML entities
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deck [
<!ENTITY defcards '
<card id="1"/>
<card id="2"/>
<card id="3"/>
<card id="4"/>
<card id="5"/>
<card id="6"/>
<card id="7"/>
<card id="8"/>
<card id="9"/>
<card id="0"/>
<scard id="SK" type="reverse"/>
<scard id="RV" type="skip"/>
<scard id="D2" type="draw" amount="2"/>
'>
]>
<deck>
<color id="R" name="Red">
&defcards;
</color>
<color id="G" name="Red">
&defcards;
</color>
<color id="B" name="Red">
&defcards;
</color>
<color id="Y" name="Red">
&defcards;
</color>
</deck><?xml version="1.0" encoding="UTF-8"?>
<deck>
<color id="R" name="Red">
<card id="1"/>
<card id="2"/>
<card id="3"/>
<card id="4"/>
<card id="5"/>
<card id="6"/>
<card id="7"/>
<card id="8"/>
<card id="9"/>
<card id="0"/>
<scard id="SK" type="reverse"/>
<scard id="RV" type="skip"/>
<scard id="D2" type="draw" amount="2"/>
</color>
<color id="G" name="Red">
<card id="1"/>
<card id="2"/>
<card id="3"/>
<card id="4"/>
<card id="5"/>
<card id="6"/>
<card id="7"/>
<card id="8"/>
<card id="9"/>
<card id="0"/>
<scard id="SK" type="reverse"/>
<scard id="RV" type="skip"/>
<scard id="D2" type="draw" amount="2"/>
</color>
<color id="B" name="Red">
<card id="1"/>
<card id="2"/>
<card id="3"/>
<card id="4"/>
<card id="5"/>
<card id="6"/>
<card id="7"/>
<card id="8"/>
<card id="9"/>
<card id="0"/>
<scard id="SK" type="reverse"/>
<scard id="RV" type="skip"/>
<scard id="D2" type="draw" amount="2"/>
</color>
<color id="Y" name="Red">
<card id="1"/>
<card id="2"/>
<card id="3"/>
<card id="4"/>
<card id="5"/>
<card id="6"/>
<card id="7"/>
<card id="8"/>
<card id="9"/>
<card id="0"/>
<scard id="SK" type="reverse"/>
<scard id="RV" type="skip"/>
<scard id="D2" type="draw" amount="2"/>
</color>
</deck><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deck [
<!ENTITY sscode "your code here">
<!ENTITY cscode "your code here">
<!ENTITY defcards '
<card id="1"/>
<card id="2"/>
<card id="3"/>
<card id="4"/>
<card id="5"/>
<card id="6"/>
<card id="7"/>
<card id="8"/>
<card id="9"/>
<card id="0"/>
<scard id="SK" type="reverse" skamt="6"/>
<scard id="RV" type="skip"/>
<scard id="D2" type="draw" amount="2"/>
<ccard id="CC" ssc="&sscode;" csc="&cscode;">OPTIONAL TEXT</ccard>
'>
]>
<deck>
<color id="R" name="Red">
&defcards;
</color>
<color id="G" name="Red">
&defcards;
</color>
<color id="B" name="Red">
&defcards;
</color>
<color id="Y" name="Yellow">
&defcards;
</color>
</deck>
self.douacis a dictionary where the keys are the usernames of the player and the values are the decks of the players, the reason it's douac and not decks is becausedouacis an acronym fordictionary of users and cards
self.deckis a list of cards that is being used by the current UNO game
self.playersis a list of all current players
self.ccardis the current card
self.discardis the list of cards that have been played from first to last, aka a discord pile
self.skamtis the amount of consecutive skips to be done, this is normally1for vanilla UNO skips, but can be higher, for example2will skip the turn for the next player and the turn for the player after that, so the person that plays a custom skip card can be skipped by said card ifself.skamtis large enough
self.reverse()is the function to call that will reverse the order of the players
playeris the current player that is playing a card
indis the index of the array of cards that is the player's hand