示例#1
0
from TicTacToe import TicTacToe
from Puzzle import Puzzle
from Configuration import Configuration
from SimpleJungle import SimpleJungle
import time

if __name__ == "__main__":

    Configuration = Configuration()

    puzzle = Puzzle()
    ticTacToe = TicTacToe()
    simpleJungle = SimpleJungle()

    puzzle.createMatrix()
    puzzle.shakeMatrix(puzzle.getMatrix())

    ticTacToe.createBoard()

    for i in range(Configuration.times_tests):
        print '\nTest ' + str(i)

        #xsAndOs.randomBoard()

        start = time.time()

        #puzzle.Astar(puzzle.getMatrix())
        #ticTacToe.playTicTacToe()
        simpleJungle.play()

        end = time.time()
示例#2
0
from Configuration import Configuration
from TicTacToe import TicTacToe
from SimpleJungle import SimpleJungle
import time

if __name__ == "__main__":

    puzzle = Puzzle()
    config = Configuration()
    ticTacToe = TicTacToe()
    simpleJungle = SimpleJungle()

    # Puzzle inicialization
    print 'Matrix'
    puzzle.createMatrix()
    puzzle.printMatrix(puzzle.getMatrix())

    print 'After shake'
    puzzle.shakeMatrix(puzzle.getMatrix())
    puzzle.printMatrix(puzzle.getMatrix())

    # Xs and Os inicialization
    print 'Tic-Tac-Toe'
    ticTacToe.createBoard()
    ticTacToe.printBoard()

    print 'Algoritms 8-Puzzle'
    print ' 1 - Breadth-first search'
    print ' 2 - Depth-first search'
    print ' 3 - Iterative deepening depth-first search'
    print ' 4 - A*'