code optimization after piotrek fucked up
This commit is contained in:
parent
a6c0a708d6
commit
309d93ef9f
@ -3,7 +3,7 @@ from random import choices
|
|||||||
|
|
||||||
|
|
||||||
def generate_field() -> List[List[int]]:
|
def generate_field() -> List[List[int]]:
|
||||||
return [choices(range(9), weights=[8, 8, 4, 4, 4, 4,4,4,4], k=10) for _ in range(10)]
|
return [choices(range(9), weights=[8, 8, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range(10)]
|
||||||
|
|
||||||
|
|
||||||
class Environment:
|
class Environment:
|
||||||
|
@ -3,8 +3,7 @@ import pygame as pg
|
|||||||
from const import ICON
|
from const import ICON
|
||||||
from agent import Agent
|
from agent import Agent
|
||||||
from game_ui import GameUi
|
from game_ui import GameUi
|
||||||
from const import DEFAULT_FIELD
|
from environment import Environment
|
||||||
from environment import Environment,generate_field
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -12,7 +11,7 @@ def main():
|
|||||||
pg.display.set_caption('Super Saper')
|
pg.display.set_caption('Super Saper')
|
||||||
pg.display.set_icon(pg.image.load(ICON))
|
pg.display.set_icon(pg.image.load(ICON))
|
||||||
|
|
||||||
env = Environment(generate_field())
|
env = Environment()
|
||||||
agent = Agent()
|
agent = Agent()
|
||||||
game_ui = GameUi(agent, env)
|
game_ui = GameUi(agent, env)
|
||||||
game_ui.update()
|
game_ui.update()
|
||||||
|
Loading…
Reference in New Issue
Block a user