From 396f5e4589bcade614c8f4b7ff2abd48f292f9d3 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 7 Dec 2016 18:02:14 +0100 Subject: [PATCH] add dependencies for mac and an updater :) --- install_dependencies.command | 6 ++++++ readme.md | 24 ++++++++++++++++++++++-- start-game.bat | 1 + start-game.command | 1 + tic_tac_toe.py | 7 ++++++- updater.py | 4 ++++ 6 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 install_dependencies.command create mode 100644 updater.py diff --git a/install_dependencies.command b/install_dependencies.command new file mode 100644 index 0000000..a548572 --- /dev/null +++ b/install_dependencies.command @@ -0,0 +1,6 @@ +cd "$(dirname "$0")" +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +brew install git +sudo xcode-select --install +brew install python +sudo pip install gitpython diff --git a/readme.md b/readme.md index b93608c..de59437 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,25 @@ -First run the python msi installer if on windows -if on mac run the .pkg file +First for windows users do these instructions: +install [git](http://git-scm.com/download/win) and make the git commands available to the windows command prompt.. + + when you see this: + +![git setup image](http://i.gyazo.com/50f6fa4ac05ea7a75c2f5275837e89d1.png) + + pick the 3rd option (available to command prompt plus linux utils) + + when you see: + +![git setup image](http://i.gyazo.com/0eeb0f1dded7534ea1c0865bfa1f82e0.png) + + pick the 1st option.. (checkout windows-style, commit unix-style) +After you do these steps open cmd and then cd to your desktop or anywhere you want to put the tic tac toe game in +example : +cd c:\Users\(username)\Desktop +then do these commands : +git clone https://github.com/mgracer48/tic-tac-toe +git checkout stable +Then run install_depdencies.command(on mac) +Then run the python msi installer if on windows then if your on windows run the start-game.bat if on mac run start-game.command and thats it :) diff --git a/start-game.bat b/start-game.bat index 3598d5a..acb8e3b 100644 --- a/start-game.bat +++ b/start-game.bat @@ -1,3 +1,4 @@ @echo off +git pull python tic_tac_toe.py pause diff --git a/start-game.command b/start-game.command index f4a950a..6b52625 100755 --- a/start-game.command +++ b/start-game.command @@ -1,2 +1,3 @@ cd "$(dirname "$0")" +python updater.py python tic_tac_toe.py diff --git a/tic_tac_toe.py b/tic_tac_toe.py index 55015dc..71bc26f 100644 --- a/tic_tac_toe.py +++ b/tic_tac_toe.py @@ -36,7 +36,7 @@ def checkAll(char): return True if checkLine(char, 2, 5, 8): return True - + def show(): print board[0], '|', board[1], '|', board[2] print '----------' @@ -50,6 +50,7 @@ def multiplayer(): input = int(input) if board[input] != 'x' and board[input] != 'o': board[input] = 'x' + show() #check if checkAll('x') == True: print "Player 1 wins!" @@ -99,6 +100,10 @@ def single_player(): if selectmode == 'single player': while True: single_player() + #if win == True: + # askplayagain = raw_input('Want to play again? Enter y for yes or n for no.') + + #playagain() break elif selectmode == 'multiplayer': while True: diff --git a/updater.py b/updater.py new file mode 100644 index 0000000..6d86903 --- /dev/null +++ b/updater.py @@ -0,0 +1,4 @@ +import git + +g = git.cmd.Git(git_dir) +g.pull()