diff --git a/__pycache__/cursor.cpython-312.pyc b/__pycache__/cursor.cpython-312.pyc index 9d714f1..7fe9709 100644 Binary files a/__pycache__/cursor.cpython-312.pyc and b/__pycache__/cursor.cpython-312.pyc differ diff --git a/__pycache__/free_space.cpython-312.pyc b/__pycache__/free_space.cpython-312.pyc index ea5f493..b7abe34 100644 Binary files a/__pycache__/free_space.cpython-312.pyc and b/__pycache__/free_space.cpython-312.pyc differ diff --git a/__pycache__/mine.cpython-312.pyc b/__pycache__/mine.cpython-312.pyc index 9efde47..6f18284 100644 Binary files a/__pycache__/mine.cpython-312.pyc and b/__pycache__/mine.cpython-312.pyc differ diff --git a/__pycache__/spawner.cpython-312.pyc b/__pycache__/spawner.cpython-312.pyc index 80365de..d60f059 100644 Binary files a/__pycache__/spawner.cpython-312.pyc and b/__pycache__/spawner.cpython-312.pyc differ diff --git a/cursor.py b/cursor.py index bf3ebc3..34bc846 100644 --- a/cursor.py +++ b/cursor.py @@ -28,10 +28,6 @@ class Cursor: if game.on_board(new_position): if game.is_empty(new_position): self.position = new_position - - def hide(self): - ''' - This is called because I was calling this method based on an agent's location, but I don't need the - cursor to do anything. - ''' - pass \ No newline at end of file + else: + game.get_agents_by_position()[new_position][0].display = False + self.position = new_position \ No newline at end of file diff --git a/free_space.py b/free_space.py index c5565e5..876a39a 100644 --- a/free_space.py +++ b/free_space.py @@ -6,7 +6,6 @@ class FreeSpace: character = '*' - display = True revealed = False neighbors = 0 @@ -77,9 +76,7 @@ class FreeSpace: Make sure a number is hidden when the cursor is over it. This is needed to allow the cursor to move over a spot where a number is. ''' - if (not game.is_empty(self.position)) and self.revealed and self.display == True: - self.display = False - elif game.is_empty(self.position) and self.revealed and self.neighbors > 0 and self.display == False: + if game.is_empty(self.position) and self.revealed and self.display == False: self.display = True diff --git a/mine.py b/mine.py index bd6727a..324b788 100644 --- a/mine.py +++ b/mine.py @@ -30,12 +30,9 @@ class Mine: def play_turn(self, game): ''' - Make sure the mine is hidden when the cursor is over it. This is needed to allow the cursor to move - over a spot where a mine is. + Make sure the mine appears when the cursor is not on it. ''' - if (not game.is_empty(self.position)): - self.display = False - elif game.is_empty(self.position): + if game.is_empty(self.position): self.display = True def reveal(self): diff --git a/spawner.py b/spawner.py index f1a6743..a204348 100644 --- a/spawner.py +++ b/spawner.py @@ -45,9 +45,6 @@ class Spawner: cursor = Cursor((self.board_width - 1, self.board_height - 1)) game.add_agent(cursor) # Print instructions. - game.log("To move, use the arrow keys. You may have to") - game.log("press an arrow key more than once to move.") - game.log("Please make sure the cursor is where you want it") - game.log("before selecting a space. To select a space, ") + game.log("To move, use the arrow keys. To select a space, ") game.log("press return. The game is over when all spots") game.log("with mines are surrounded by numbers.") \ No newline at end of file