Ejemplo n.º 1
0
from game import Game
from textui import TextUI

ui = TextUI()

players = ui.displayWelcome()

players = ui.promptForPlayers()

warGame = Game(players)

ui.preGame(warGame)

while not warGame.gameOver():
    warGame.run()
    ui.displayTurn(warGame)

ui.displayGameOver(warGame)
Ejemplo n.º 2
0
def main():
    game = BrainInTheBox()
    #ee = EarthExtractor(ml, 20, 10)
    #ml.printmap()
    ui = TextUI(game)
    ui.run()
Ejemplo n.º 3
0
#!/usr/bin/python3

from textui import TextUI
from checkersboard import CheckersBoard
from aiplayer import AIPlayer
from player import Player

ui = TextUI()
colors = ["B", "W"]
board = CheckersBoard(8, colors)
ai = AIPlayer(colors[0])
human = Player(colors[1])

running = True

while running:
    textBoard = ui.drawBoard(board)
    print(textBoard.draw())

    moves = board.playerMoves(human)
    for move in moves:
        print("Start {}, End {}".format(move.startPos, move.endPos))

    # startPos = ui.getStartPos()

    # if board.validPlayerPos(human, startPos):
    #     print("Valid Selection")
    # else:
    #     ui.invalidPosition(startPos)

    # endPos = ui.getEndPos()