code optimization after piotrek fucked up

This commit is contained in:
matixezor 2021-03-16 20:22:27 +01:00
parent a6c0a708d6
commit 309d93ef9f
2 changed files with 3 additions and 4 deletions

View File

@ -3,7 +3,7 @@ from random import choices
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:

View File

@ -3,8 +3,7 @@ import pygame as pg
from const import ICON
from agent import Agent
from game_ui import GameUi
from const import DEFAULT_FIELD
from environment import Environment,generate_field
from environment import Environment
def main():
@ -12,7 +11,7 @@ def main():
pg.display.set_caption('Super Saper')
pg.display.set_icon(pg.image.load(ICON))
env = Environment(generate_field())
env = Environment()
agent = Agent()
game_ui = GameUi(agent, env)
game_ui.update()