From e26b6efd2d24070e2495721c1b6876fc756d7c7f Mon Sep 17 00:00:00 2001 From: AviationSFO Date: Sun, 17 Jul 2022 10:31:06 -0700 Subject: [PATCH 1/2] fix windows launching error --- prefs.json | 11 ++++++++++- turtlesnake.py | 11 ++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/prefs.json b/prefs.json index d901edf..c97e96b 100644 --- a/prefs.json +++ b/prefs.json @@ -1 +1,10 @@ -{"highscore": 0, "bgcolor": "dark green", "foodcolor": "navy", "foodshape": "square", "foodnum": 2, "mutesound": true, "headcolor": "white", "tailcolor": "blue"} \ No newline at end of file +{ + "highscore": 0, + "bgcolor": "dark green", + "foodcolor": "navy", + "foodshape": "square", + "foodnum": 2, + "mutesound": true, + "headcolor": "white", + "tailcolor": "blue" +} \ No newline at end of file diff --git a/turtlesnake.py b/turtlesnake.py index cd1c078..06325f2 100644 --- a/turtlesnake.py +++ b/turtlesnake.py @@ -48,8 +48,7 @@ noplaysound = True global high_score global mutesound -with open(path.expanduser( - "~/Desktop/SnakeGame/prefs.json"), "r") as read_file: +with open("prefs.json", "r") as read_file: prefs = json.load(read_file) high_score = prefs["highscore"] bgcolor = prefs["bgcolor"] @@ -66,8 +65,7 @@ score = 0 APIon = False # opening files -datadoc = open(path.expanduser( - "~/Desktop/SnakeGame/data.txt"), "a") +datadoc = open("data.txt", "a") foodnum = int(foodnum) if foodnum == 2: @@ -83,7 +81,7 @@ print("Error: last highscore is not an integer.") wn = turtle.Screen() -wn.title("Snake Game Project v1.13.0") +wn.title("Snake Game Project DEVELOPMENT") wn.bgcolor(bgcolor) # the width and height can be put as user's choice wn.setup(width=600, height=600) @@ -436,8 +434,7 @@ def exit(): } if changedcolor == False: - with open(path.expanduser( - "~/Desktop/SnakeGame/prefs.json"), "w") as write_file: + with open("prefs.json", "w") as write_file: json.dump(prefs, write_file) else: quit() From 2706f50080038c473cfae4be328dedb25807ebeb Mon Sep 17 00:00:00 2001 From: AviationSFO Date: Sun, 17 Jul 2022 10:33:58 -0700 Subject: [PATCH 2/2] v1.13.1 --- install.sh | 2 +- turtlesnake.py | 4 ++-- version.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 1f20dc5..3ad5c0c 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ # Is it possible to have install script clone from latest version rather than the latest commit? - +# !!!!MACOS ONLY!!!! cd ~/Desktop git clone https://github.com/AviationSFO/SnakeGame diff --git a/turtlesnake.py b/turtlesnake.py index 06325f2..086a5da 100644 --- a/turtlesnake.py +++ b/turtlesnake.py @@ -1,4 +1,4 @@ -# Python Snake Game by Steven Weinstein on 3-10-2022. Version available in version.txt +# Python Snake Game by Steven Weinstein on 7-17-2022. Version available in version.txt # import required modules TK_SILENCE_DEPRECATION = 1 from platform import python_version @@ -81,7 +81,7 @@ print("Error: last highscore is not an integer.") wn = turtle.Screen() -wn.title("Snake Game Project DEVELOPMENT") +wn.title("Snake Game Project v1.13.1") wn.bgcolor(bgcolor) # the width and height can be put as user's choice wn.setup(width=600, height=600) diff --git a/version.txt b/version.txt index 0fd9a9a..2a82924 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -Version STABLE v1.13.0 \ No newline at end of file +Version STABLE v1.13.1 \ No newline at end of file