fix: value exceptions

This commit is contained in:
mnjx
2023-03-10 02:10:14 -10:00
parent 8bb9d9f836
commit 444be502b1
3 changed files with 467 additions and 3 deletions
+14 -2
View File
@@ -1,7 +1,7 @@
# TODO -
# add:
# fix:
# fix: general bugfixes
# update:
# algorithm steps
@@ -61,10 +61,11 @@ def init():
clearScreen()
print("Size of the playfield (n*n):", size)
F_printOneMoreTime = 0
if size <= 2:
if size < 3:
clearScreen()
print("Size of the playfield (n*n):", size, "(changed to 3*3)")
size = 3
_size = size
# 03 -> allow a user to enter names of two players
@@ -84,8 +85,19 @@ def init():
continue
if F_printOneMoreTime == 1:
clearScreen()
print("Size of the playfield (n*n):", size, "(changed to 3*3)")
print("Name of the first player:", name1)
print("Name of the second player:", name2)
print("Number of symbols inline needed to win:", symbolCount)
F_printOneMoreTime = 0
if symbolCount > _size >= 0:
clearScreen()
print("Size of the playfield (n*n):", _size)
print("Name of the first player:", name1)
print("Name of the second player:", name2)
print("Number of symbols inline needed to win:", symbolCount, f"(changed to {_size}*{_size})")
symbolCount = _size
time.sleep(2)
# creating the playfield
pf = [] # pf is shor for PlayField