Metadata-Version: 2.1
Name: pycribbage
Version: 1.0.0
Summary: A Python application to play the card game cribbage
Author-email: John Otter <jjotter26@gmail.com>
License: MIT License
        
        Copyright (c) 2023 John Otter
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/jotter91/PythonCribbage
Keywords: cribbage
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest ; extra == 'dev'

[![Python application](https://github.com/jotter91/PythonCribbage/actions/workflows/python-app2.yml/badge.svg)](https://github.com/jotter91/PythonCribbage/actions/workflows/python-app2.yml)
[![codecov](https://codecov.io/gh/jotter91/PythonCribbage/graph/badge.svg?token=6K8NJAFX8D)](https://codecov.io/gh/jotter91/PythonCribbage)
## PyCribbage

PyCribbage is a Python application for playing a card game called Cribbage. It was created to demonstrate my ability to apply OOP concepts, follow a TDD process and apply SOLID coding principles.

An overview of the rules of the game and the terminology used can be found here : https://www.theukrules.co.uk/rules/children/games/cards/cribbage.html

## Installation

PyCribbage was created with Python 3.8.5, but it should work with Python 3+. 
There are no additional dependencies required so one should one be able to use this library with a standard Python 3.8.5 installation. 

```
mkdir cribbage
cd cribbage
git clone https://github.com/jotter91/PythonCribbage
```

To run the tests then there are some additional packages required, please see requirements_dev.txt. These can be installed as follows:

```
python -m venv .venv/
source .venv/bin/activate # Line to enter before any commands below
python -m pip install -r requirements_dev.txt
```



## Usage

To play an interactive game launch main.py and follow the on screen prompts

```
python pycribbage/main.py
```

The prompts will ask for information on which methods to use. The methods are split into the two parts of a cribbage game, The Show and The Play. Currently your opponent can use either a random choice during the game or a repeatable choice (useful for replaying the same game). 

If you would like to play a computer player then enter the information as follows: 
```
Enter the name for the 1 Player:
Human
Enter the method for this player's 'The Show'
[0] For Fixed index
[1] For Random
[2] For Human
2
Enter the method for this player's 'The Play'
[0] For Fixed index
[1] For Random
[2] For Human
2
Enter the name for the Second Player:
Bot
Enter the method for this player's 'The Show'
[0] For Fixed index
[1] For Random
[2] For Human
1
Enter the method for this player's 'The Play'
[0] For Fixed index
[1] For Random
[2] For Human
1
```

To run the tests : 

```
python -m pytest tests
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

