tmscli 0.2.4__tar.gz → 0.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tmscli
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: runs minesweeper in your terminal, type rules for how to play
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "tmscli"
7
- version = "0.2.4"
7
+ version = "0.2.5"
8
8
  description = "runs minesweeper in your terminal, type rules for how to play"
9
9
  dependencies = []
10
10
 
@@ -109,6 +109,8 @@ def main_loop(board):
109
109
  terminal_minesweeper.print_board(board)
110
110
  cmd=input()
111
111
  cmds=cmd.split()
112
+ if cmds[1]>terminal_minesweeper.size or cmds[1]<0 or cmds[2]>terminal_minesweeper.size or cmds[2]<0:
113
+ print('coordinate out of range, please try again')
112
114
  if cmds[0]=='uc':
113
115
  if (not board[int(cmds[1])-1][int(cmds[2])-1][0]) and (not board[int(cmds[1])-1][int(cmds[2])-1][1]):
114
116
  board[int(cmds[1])-1][int(cmds[2])-1][0]=True
@@ -126,6 +128,8 @@ def main_loop(board):
126
128
  board[int(cmds[1])-1][int(cmds[2])-1][0]=False
127
129
  else:
128
130
  print('already not flagged')
131
+ else:
132
+ print('unrecognised command, please try again')
129
133
  terminal_minesweeper.check(board)
130
134
  def run():
131
135
  mines=terminal_minesweeper.get_mines()
File without changes
File without changes