コード例 #1
0
ファイル: main.py プロジェクト: MarcinKap/Python-Game-of-life
def main():
    print("zaczynamy")

    board_model = Board((255, 255, 255), 640, 480)
    board_view = BoardView(board_model)
    board_controller = BoardController(board_model, board_view)

    board_controller.create_buttons()
    board_controller.create_inputs()

    board_view.show()
コード例 #2
0
#pip install anytree
from controllers.board_controller import BoardController
from models.move import Move
from models.board import Board

controller = BoardController()
controller.init_game()
コード例 #3
0
from controllers.board_controller import BoardController
from models.move import Move
from models.board import Board

player0 = 0
player1 = 0
player2 = 0

while (player1 + player2 + player0) < 10:

    controller = BoardController()
    quemGanhou = controller.init_game()

    if (quemGanhou == 1):
        player1 += 1
    elif (quemGanhou == 2):
        player2 += 1
    elif (quemGanhou == 1):
        player0 += 1

    print ''
    print "-----------PLACAR-TOTAL-------------"
    print 'Player1: ', controller.white_player.name(), player1
    print 'Player2: ', controller.black_player.name(), player2
    print 'Empate: ', player0
コード例 #4
0
from controllers.board_controller import BoardController
from models.move                  import Move
from models.board                 import Board

player0=0
player1=0
player2=0

while (player1+player2+player0) < 10 :


  controller = BoardController()
  quemGanhou = controller.init_game()

  if (quemGanhou ==1):
    player1+=1
  elif (quemGanhou ==2):
    player2+=1
  elif (quemGanhou ==1):
    player0+=1

  print ''
  print "-----------PLACAR-TOTAL-------------"
  print 'Player1: ', controller.white_player.name(), player1
  print 'Player2: ', controller.black_player.name(), player2
  print 'Empate: ', player0
コード例 #5
0
ファイル: main.py プロジェクト: FelipeMDuarte/othelloIA
from controllers.board_controller import BoardController
from models.move                  import Move
from models.board                 import Board

controller = BoardController()
controller.init_game()
コード例 #6
0
"""Inicio da aplicacao."""

from controllers.board_controller import BoardController

CONTROLLER = BoardController()
CONTROLLER.init_game()
コード例 #7
0
from controllers.menu_controller import MenuController
from controllers.board_controller import BoardController

menu_controller = MenuController()
board_controller = BoardController()

key_mapping = {
    "menu_x": menu_controller.exit_action,
    "menu_s": menu_controller.start_action,
    "menu_home": menu_controller.home_action,
    "board_home": board_controller.home_action,
    "board_b": board_controller.back_action
}
コード例 #8
0
import os
from flask import Flask
from flask_socketio import SocketIO

from controllers.board_controller import BoardController
# from models.metrics.metric import Metric

templates_path = os.path.join(os.getcwd(), "templates")

app = Flask(__name__, template_folder=templates_path)
socketio = SocketIO(app)

# metric_model = Metric()
metrics = []  # Array of Metric
merged_metrics = {}  # {"metric_name": metric_names[]}

app.add_url_rule("/board",
                 view_func=BoardController.as_view("board",
                                                   metrics=metrics,
                                                   merged=merged_metrics,
                                                   socket=socketio))

if __name__ == "__main__":
    socketio.run(app, host="0.0.0.0", debug=True)