cards-deck
v1.4.5
Published
poker cards deck
Downloads
1
Readme
��#� �D�e�c�k� �M�o�d�u�l�e�
�
�
�
�T�h�e� ��D�e�c�k�
� �m�o�d�u�l�e� �p�r�o�v�i�d�e�s� �a� �c�l�a�s�s� �f�o�r� �w�o�r�k�i�n�g� �w�i�t�h� �a� �d�e�c�k� �o�f� �c�a�r�d�s�.� �I�t� �i�n�c�l�u�d�e�s� �m�e�t�h�o�d�s� �f�o�r� �c�r�e�a�t�i�n�g� �a� �f�r�e�s�h� �d�e�c�k� �a�n�d� �s�h�u�f�f�l�i�n�g� �t�h�e� �d�e�c�k�.�
�
�
�
�#�#� �U�s�a�g�e�
�
�
�
�F�i�r�s�t�,� �i�m�p�o�r�t� �t�h�e� ��D�e�c�k�
� �c�l�a�s�s�:�
�
�
�
��
��j�a�v�a�s�c�r�i�p�t�
�
�i�m�p�o�r�t� �{� �D�e�c�k� �}� �f�r�o�m� �"�c�a�r�d�s�-�d�e�c�k�"�;� �
�
�
��
�
�
�
�
�#�#� �C�r�e�a�t�i�n�g� �a� �F�r�e�s�h� �D�e�c�k�
�
�
�
�T�o� �c�r�e�a�t�e� �a� �f�r�e�s�h� �d�e�c�k� �o�f� �c�a�r�d�s�,� �y�o�u� �c�a�n� �u�s�e� �t�h�e� ��f�r�e�s�h�D�e�c�k�
� �m�e�t�h�o�d� �p�r�o�v�i�d�e�d� �b�y� �t�h�e� ��D�e�c�k�
� �c�l�a�s�s�:�
�
�
�
��
��j�a�v�a�s�c�r�i�p�t�
�
�c�o�n�s�t� �d�e�c�k� �=� �n�e�w� �D�e�c�k�(�)�;�
�
�
��
�
�
�
�
�T�h�e� �f�r�e�s�h�D�e�c�k� �m�e�t�h�o�d� �g�e�n�e�r�a�t�e�s� �a� �n�e�w� �d�e�c�k� �o�f� �5�2� �c�a�r�d�s�,� �i�n�c�l�u�d�i�n�g� �t�h�e� �s�t�a�n�d�a�r�d� �4� �s�u�i�t�s� �(�&,� �c&,� �f&,� �e&)� �a�n�d� �1�4� �v�a�l�u�e�s� �(�A�,� �2�,� �3�,� �4�,� �5�,� �6�,� �7�,� �8�,� �9�,� �1�0�,� �J�,� �Q�,� �K�,� �J�O�K�E�R�)�.�
�
�
�
�#�#� �S�h�u�f�f�l�i�n�g� �t�h�e� �D�e�c�k�
�
�
�
�Y�o�u� �c�a�n� �s�h�u�f�f�l�e� �t�h�e� �d�e�c�k� �o�f� �c�a�r�d�s� �u�s�i�n�g� �t�h�e� �s�h�u�f�f�l�e� �m�e�t�h�o�d�:�
�
�
�
�
��
�j�a�v�a�s�c�r�i�p�t�
�
�d�e�c�k�.�s�h�u�f�f�l�e�(�)�;�
�
��
��
�
�
�
�T�h�e� �s�h�u�f�f�l�e� �m�e�t�h�o�d� �s�h�u�f�f�l�e�s� �t�h�e� �o�r�d�e�r� �o�f� �t�h�e� �c�a�r�d�s� �u�s�i�n�g� �F�i�s�h�e�r�-�Y�a�t�e�s� �a�l�g�o�r�i�t�h�m�,� �p�r�o�v�i�d�i�n�g� �a� �r�a�n�d�o�m�i�z�e�d� �o�r�d�e�r�.�
�
�
�
�#� �E�x�a�m�p�l�e�
�
�
�
�
��
�j�a�v�a�s�c�r�i�p�t�
�
�i�m�p�o�r�t� �{� �D�e�c�k� �}� �f�r�o�m� �"�c�a�r�d�s�-�d�e�c�k�"�;�
�
�
�
�c�o�n�s�t� �d�e�c�k� �=� �n�e�w� �D�e�c�k�(�)�;�
�
�
�
�/�/� �C�r�e�a�t�e� �a� �f�r�e�s�h� �d�e�c�k�
�
�c�o�n�s�t� �f�r�e�s�h�D�e�c�k� �=� �d�e�c�k�.�f�r�e�s�h�D�e�c�k�(�)�;�
�
�c�o�n�s�o�l�e�.�l�o�g�(�"�F�r�e�s�h� �D�e�c�k�:�"�,� �f�r�e�s�h�D�e�c�k�)�;�
�
�
�
�/�/� �S�h�u�f�f�l�e� �t�h�e� �d�e�c�k�
�
�d�e�c�k�.�s�h�u�f�f�l�e�(�)�;�
�
�c�o�n�s�o�l�e�.�l�o�g�(�"�S�h�u�f�f�l�e�d� �D�e�c�k�:�"�,� �d�e�c�k�.�c�a�r�d�s�)�;�
�
��
�`�
�
�
�
�#�#�#� �L�i�c�e�n�s�e�
�
�
�
�T�h�i�s� �m�o�d�u�l�e� �i�s� �o�p�e�n�-�s�o�u�r�c�e� �a�n�d� �a�v�a�i�l�a�b�l�e� �u�n�d�e�r� �t�h�e� �M�I�T� �L�i�c�e�n�s�e�.� �Y�o�u� �a�r�e� �f�r�e�e� �t�o� �u�s�e� �a�n�d� �m�o�d�i�f�y� �i�t� �a�s� �n�e�e�d�e�d� �f�o�r� �y�o�u�r� �p�r�o�j�e�c�t�s�.�
�
�