добавлен код с дз по постановке кораблей по размеру
This commit is contained in:
parent
a2bc915a4a
commit
dd539555b9
|
@ -5,9 +5,8 @@
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="b389cdea-22f5-4ba2-8b46-337091984b3c" name="Changes" comment="код по 22 части урока">
|
<list default="true" id="b389cdea-22f5-4ba2-8b46-337091984b3c" name="Changes" comment="код по 22 части урока">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ShipView.py" beforeDir="false" afterPath="$PROJECT_DIR$/ShipView.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ShipField.py" beforeDir="false" afterPath="$PROJECT_DIR$/ShipField.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -38,17 +37,17 @@
|
||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"Python.ShipField.executor": "Run",
|
"Python.ShipField.executor": "Run",
|
||||||
"Python.main (1).executor": "Run",
|
"Python.main (1).executor": "Run",
|
||||||
"Python.main.executor": "Debug",
|
"Python.main.executor": "Debug",
|
||||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"git-widget-placeholder": "main",
|
"git-widget-placeholder": "main",
|
||||||
"last_opened_file_path": "Y:/Downloads/временный гит/hnc-eduard/HNS/Excercises/ShipCraft/Переделка"
|
"last_opened_file_path": "Y:/Downloads/временный гит/hnc-eduard/HNS/Excercises/ShipCraft/Переделка"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RunManager" selected="Python.main">
|
<component name="RunManager" selected="Python.main">
|
||||||
<configuration name="ShipField" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
<configuration name="ShipField" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
||||||
<module name="Переделка" />
|
<module name="Переделка" />
|
||||||
|
|
|
@ -110,6 +110,9 @@ class ShipField:
|
||||||
self.ships.remove(self.ship_size)
|
self.ships.remove(self.ship_size)
|
||||||
self.print_field()
|
self.print_field()
|
||||||
|
|
||||||
|
if self.ship_size not in self.ships and len(self.ships) > 0:
|
||||||
|
self.ship_size = max(self.ships)
|
||||||
|
|
||||||
def get_ship(self, row, col):
|
def get_ship(self, row, col):
|
||||||
if row < 0 or row > ShipField.field_size:
|
if row < 0 or row > ShipField.field_size:
|
||||||
return
|
return
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue