|
3 | 3 | import colorama
|
4 | 4 | import platform
|
5 | 5 |
|
| 6 | +from typing import List, Tuple |
6 | 7 | from colorama import Fore, Style
|
7 | 8 | from torpydo.ship import Color, Letter, Position, Ship
|
8 | 9 | from torpydo.game_controller import GameController
|
@@ -166,7 +167,7 @@ def initialize_myFleet():
|
166 | 167 |
|
167 | 168 | myFleet = GameController.initialize_ships()
|
168 | 169 |
|
169 |
| - quick_and_dirty = True |
| 170 | + quick_and_dirty = False |
170 | 171 | if quick_and_dirty:
|
171 | 172 | myFleet[0].positions.append(Position(Letter.B, 4))
|
172 | 173 | myFleet[0].positions.append(Position(Letter.B, 5))
|
@@ -197,17 +198,17 @@ def initialize_myFleet():
|
197 | 198 | print()
|
198 | 199 | print(f"Please enter the positions for the {ship.name} (size: {ship.size})")
|
199 | 200 |
|
200 |
| - i = 0 |
201 |
| - while i < ship.size: |
202 |
| - try: |
203 |
| - position_input = check_position_input(f"Enter position {i+1} of {ship.size} (i.e A3):") |
204 |
| - except Exception: |
205 |
| - print(BAD_POSITION_INPUT_MSG) |
206 |
| - continue |
207 |
| - else: |
208 |
| - ship.add_position(position_input) |
209 |
| - i += 1 |
210 |
| - TelemetryClient.trackEvent('Player_PlaceShipPosition', {'custom_dimensions': {'Position': position_input, 'Ship': ship.name, 'PositionInShip': i}}) |
| 201 | + i = 0 |
| 202 | + while i < ship.size: |
| 203 | + try: |
| 204 | + position_input = check_position_input(f"Enter position {i+1} of {ship.size} (i.e A3):") |
| 205 | + except Exception: |
| 206 | + print(BAD_POSITION_INPUT_MSG) |
| 207 | + continue |
| 208 | + else: |
| 209 | + ship.add_position(position_input) |
| 210 | + i += 1 |
| 211 | + TelemetryClient.trackEvent('Player_PlaceShipPosition', {'custom_dimensions': {'Position': position_input, 'Ship': ship.name, 'PositionInShip': i}}) |
211 | 212 |
|
212 | 213 |
|
213 | 214 | def overlaps(positions, fleet:List[Ship]):
|
|
0 commit comments