Example #1
0
from Game.basicStructs import send_moves_list as send

a = Board()

for i in range(0, 8, 2):
    a.set(i, 0, Field.AI)
    a.set(i, 6, Field.HU)

for i in range(1, 8, 2):
    a.set(i, 1, Field.AI)
    a.set(i, 7, Field.HU)

print a
turns = 0

proc = Image.ImageProcess()


def set_position(table):
    global a
    log("Board set")
    a = table


def check_game_end(table, ui):
    res = table.gameWon()
    if res != 0:
        if res == 1:
            log("AI won!")
            print "AI won!"
        else:
Example #2
0
import sys
import time
from threading import Timer

from PyQt4.QtGui import *
from PyQt4.QtCore import *

import Image.Image as Image
import Image.takeImage as Shooter
from MainApp import logger
import mainWindow
import MainApp.mainApp as main

ImageProcess = Image.ImageProcess()

image_update_flag = True


class Worker(QThread):
    run = 1

    def __init__(self, Main=None):
        super(Worker, self).__init__(Main)
        #self.ui = mainWindow.mainWindow()
        self.ui = Main
        self.new = False
        self.set_pos_flag = False
        self.dots = 0
        self.gameplay = True

    def calc_image(self):