Play the card game Baccarat
To check out a copy of the source: git clone https://github.com/fulkgl/PyBaccarat.git
This is an implementation of the card game Baccarat. It includes the code needed to play a game interactively, replay a historical game, or play a game with a particular system.
This code has been built and tested with these versions: Python 2.7.13 Python 3.6.4
- GIT (source control library). Check out a copy of the code.
To keep the origin and structure of the code obvious, I start with a $BASE (%BASE%) location. It can be a location of your choosing. Assign an environment variable to define the starting base location: in Linuxexport BASE=/home/george
or Windowsset BASE=\users\george
. Windows will use%BASE%
instead of$BASE
and the back-slash for directory separator instead of forward slash. - mkdir $BASE/github.com/fulkgl
- chdir $BASE/github.com/fulkgl
- git clone https://github.com/fulkgl/PyBaccarat.git
- Clean up temp files.
- del /s/q build dist pybaccarat.egg-info
- rmdir /s/q build dist pybaccarat.egg-info
- del /s/q tests\*.pyc pybaccarat\*.pyc
- rmdir pybaccarat\__pycache__
- Build the code
- Run the unit tests
The command git clone https://github.com/fulkgl/PyBaccarat.git
will make a copy of code from a remote host to local system,
setting up 3 trees (working directory, index, and head).
What you normally see is the working directory. The index and head
trees are inside the .git directory. And you don't normally look at them.
git status
Shows you files missing from git and files
that are changed.
git diff README.md
Git diff will show you
changed files differences.
git add README.md
Use the git add
command to move changes from the working directory to the index.
Files that are new to the repo are initially checked in with
the git add command. Files that have been changed are also
checked in this way. You often use git add one file at a time since
you specify each file with this command. Use "git reset file"
to reverse the effects of a git add command.
git commit -m "description"
Use the git commit
command to move changes from the index to the head.
You will do this for all the git added files once.
Use "git checkout" to reverse the effects of a git commit.
The description should contain a reference to the defect or feature
number that is addressing this code change.
git push origin master
Use the git push command to
move changes from the head to the remote host.
git init is used to create a new repo the first time.
Also a git remote add origin is used the first time to
associate a connection to the remote host.
browser https://github.com/fulkgl/PyBaccarat
See that the latest things look correct on the webpage.
python setup.py build bdist sdist
cd %BASE%\github.com\fulkgl\PyBaccarat
python tests\test_card.py
python tests\test_hand.py
python tests\test_scoreboard.py
python tests\test_shoe.py
python tests\test_ties.py