Skip to content

Commit

Permalink
Bump python version, uppercase inputs, fixes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
s2t2 committed Jul 25, 2024
1 parent a320e7a commit 898661a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: tests
name: python-app

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cd ~/Desktop/tic-tac-toe-py
Create a virtual environment:

```sh
conda create -n tictactoe-env python=3.8
conda create -n tictactoe-env python=3.11
```

Activate the virtual environment:
Expand Down
6 changes: 3 additions & 3 deletions app/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def play(self):

# PLAYER SELECTION

x_strategy = input("SELECT X PLAYER TYPE ('HUMAN' / 'COMPUTER-EASY' / 'COMPUTER-HARD'): ") or "HUMAN"
o_strategy = input("SELECT O PLAYER TYPE ('HUMAN' / 'COMPUTER-EASY' / 'COMPUTER-HARD'): ") or "COMPUTER-HARD"
x_strategy = input("SELECT X PLAYER TYPE ('HUMAN' / 'COMPUTER-EASY' / 'COMPUTER-HARD'): ").upper() or "HUMAN"
o_strategy = input("SELECT O PLAYER TYPE ('HUMAN' / 'COMPUTER-EASY' / 'COMPUTER-HARD'): ").upper() or "COMPUTER-HARD"

players = [
select_player(letter="X", strategy=x_strategy),
Expand All @@ -116,7 +116,7 @@ def play(self):

# GAME PLAY

preload = input("Would you like to use a pre-saved game state? (Y/N): ") or "N"
preload = input("Would you like to use a pre-saved game state? (Y/N): ").upper() or "N"
if preload.upper() == "Y":

game = Game(players=players, turn_history=[
Expand Down
6 changes: 3 additions & 3 deletions app/jobs/play_games.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from app.player import select_player
from app.jobs.timer import Timer

X_STRATEGY = os.getenv("X_STRATEGY", default="RANDOM")
O_STRATEGY = os.getenv("O_STRATEGY", default="RANDOM")
X_STRATEGY = os.getenv("X_STRATEGY", default="RANDOM").upper()
O_STRATEGY = os.getenv("O_STRATEGY", default="RANDOM").upper()

GAME_COUNT = int(os.getenv("GAME_COUNT", default="100_000"))
GAME_COUNT = int(os.getenv("GAME_COUNT", default="1_000"))


if __name__ == "__main__":
Expand Down

0 comments on commit 898661a

Please sign in to comment.