from CoordinatesToSymbols import *
from Board import *
from Player import *
from Exceptions import *

def titleForFigure(f):
    if f is None:
        return "No"
    else:
        return f.GetSymbol() + f.GetColor() # return a string object


class View(object):
    def __init__(self, board):
        self._board = board

    def Show(self):
        print ("   A    B    C    D    E    F    G    H")
        print("_" * 40)


        for item2 in [8,7,6,5,4,3,2,1]:
            string1 = ""
            for item1 in "ABCDEFGH":
                f = self._board.Figure_At(item1 + str(item2))
                string1 = string1 + titleForFigure(f) + "|  "
            print(str(item2) + "|" + string1)
            print("_" * 40)

        print ("   A    B    C    D    E    F    G    H")
        b = self._board.Get_Current_Player().GetColor()
        print ("Current Player:", b)

    def Run(self):
        self.Show()
        while True:
            move_from = raw_input("Move from:")
            move_to = raw_input("Move_to:")
            try:
                self._board.Move_Figure(move_from, move_to)

            except InvalidPosition:
                print("Invalid input")
                continue

            except EmptyField:
                print("No Figure")
                continue

            except WrongFigureColor:
                print ("Wrong Figure Color")
                continue

            except WrongMove:
                print("Wrong Move")
                continue

           # self._board.Toggle_Player()
            self.Show()
            print (BoardToMatrix(self._board)[::-1,:])








608aab04c99a0194b169c9f5b3b930a701485ffa
<mask token>


class View(object):

    def __init__(self, board):
        self._board = board
    <mask token>

    def Run(self):
        self.Show()
        while True:
            move_from = raw_input('Move from:')
            move_to = raw_input('Move_to:')
            try:
                self._board.Move_Figure(move_from, move_to)
            except InvalidPosition:
                print('Invalid input')
                continue
            except EmptyField:
                print('No Figure')
                continue
            except WrongFigureColor:
                print('Wrong Figure Color')
                continue
            except WrongMove:
                print('Wrong Move')
                continue
            self.Show()
            print(BoardToMatrix(self._board)[::-1, :])

<mask token>


class View(object):

    def __init__(self, board):
        self._board = board

    def Show(self):
        print('   A    B    C    D    E    F    G    H')
        print('_' * 40)
        for item2 in [8, 7, 6, 5, 4, 3, 2, 1]:
            string1 = ''
            for item1 in 'ABCDEFGH':
                f = self._board.Figure_At(item1 + str(item2))
                string1 = string1 + titleForFigure(f) + '|  '
            print(str(item2) + '|' + string1)
            print('_' * 40)
        print('   A    B    C    D    E    F    G    H')
        b = self._board.Get_Current_Player().GetColor()
        print('Current Player:', b)

    def Run(self):
        self.Show()
        while True:
            move_from = raw_input('Move from:')
            move_to = raw_input('Move_to:')
            try:
                self._board.Move_Figure(move_from, move_to)
            except InvalidPosition:
                print('Invalid input')
                continue
            except EmptyField:
                print('No Figure')
                continue
            except WrongFigureColor:
                print('Wrong Figure Color')
                continue
            except WrongMove:
                print('Wrong Move')
                continue
            self.Show()
            print(BoardToMatrix(self._board)[::-1, :])

<mask token>


def titleForFigure(f):
    if f is None:
        return 'No'
    else:
        return f.GetSymbol() + f.GetColor()


class View(object):

    def __init__(self, board):
        self._board = board

    def Show(self):
        print('   A    B    C    D    E    F    G    H')
        print('_' * 40)
        for item2 in [8, 7, 6, 5, 4, 3, 2, 1]:
            string1 = ''
            for item1 in 'ABCDEFGH':
                f = self._board.Figure_At(item1 + str(item2))
                string1 = string1 + titleForFigure(f) + '|  '
            print(str(item2) + '|' + string1)
            print('_' * 40)
        print('   A    B    C    D    E    F    G    H')
        b = self._board.Get_Current_Player().GetColor()
        print('Current Player:', b)

    def Run(self):
        self.Show()
        while True:
            move_from = raw_input('Move from:')
            move_to = raw_input('Move_to:')
            try:
                self._board.Move_Figure(move_from, move_to)
            except InvalidPosition:
                print('Invalid input')
                continue
            except EmptyField:
                print('No Figure')
                continue
            except WrongFigureColor:
                print('Wrong Figure Color')
                continue
            except WrongMove:
                print('Wrong Move')
                continue
            self.Show()
            print(BoardToMatrix(self._board)[::-1, :])

from CoordinatesToSymbols import *
from Board import *
from Player import *
from Exceptions import *


def titleForFigure(f):
    if f is None:
        return 'No'
    else:
        return f.GetSymbol() + f.GetColor()


class View(object):

    def __init__(self, board):
        self._board = board

    def Show(self):
        print('   A    B    C    D    E    F    G    H')
        print('_' * 40)
        for item2 in [8, 7, 6, 5, 4, 3, 2, 1]:
            string1 = ''
            for item1 in 'ABCDEFGH':
                f = self._board.Figure_At(item1 + str(item2))
                string1 = string1 + titleForFigure(f) + '|  '
            print(str(item2) + '|' + string1)
            print('_' * 40)
        print('   A    B    C    D    E    F    G    H')
        b = self._board.Get_Current_Player().GetColor()
        print('Current Player:', b)

    def Run(self):
        self.Show()
        while True:
            move_from = raw_input('Move from:')
            move_to = raw_input('Move_to:')
            try:
                self._board.Move_Figure(move_from, move_to)
            except InvalidPosition:
                print('Invalid input')
                continue
            except EmptyField:
                print('No Figure')
                continue
            except WrongFigureColor:
                print('Wrong Figure Color')
                continue
            except WrongMove:
                print('Wrong Move')
                continue
            self.Show()
            print(BoardToMatrix(self._board)[::-1, :])

from CoordinatesToSymbols import *
from Board import *
from Player import *
from Exceptions import *

def titleForFigure(f):
    if f is None:
        return "No"
    else:
        return f.GetSymbol() + f.GetColor() # return a string object


class View(object):
    def __init__(self, board):
        self._board = board

    def Show(self):
        print ("   A    B    C    D    E    F    G    H")
        print("_" * 40)


        for item2 in [8,7,6,5,4,3,2,1]:
            string1 = ""
            for item1 in "ABCDEFGH":
                f = self._board.Figure_At(item1 + str(item2))
                string1 = string1 + titleForFigure(f) + "|  "
            print(str(item2) + "|" + string1)
            print("_" * 40)

        print ("   A    B    C    D    E    F    G    H")
        b = self._board.Get_Current_Player().GetColor()
        print ("Current Player:", b)

    def Run(self):
        self.Show()
        while True:
            move_from = raw_input("Move from:")
            move_to = raw_input("Move_to:")
            try:
                self._board.Move_Figure(move_from, move_to)

            except InvalidPosition:
                print("Invalid input")
                continue

            except EmptyField:
                print("No Figure")
                continue

            except WrongFigureColor:
                print ("Wrong Figure Color")
                continue

            except WrongMove:
                print("Wrong Move")
                continue

           # self._board.Toggle_Player()
            self.Show()
            print (BoardToMatrix(self._board)[::-1,:])







