# -*- coding: utf-8-*-
from Tkinter import *
import threading
import logging
import argparse

VELIKOST = 6
MODRI = 'M'
RDECI = 'R'

#########################################

def nasprotnik(igralec):
	"Vrne nasprotnika"
	if igralec == MODRI:
		return RDECI
	elif igralec == RDECI:
		return MODRI
	else:
		assert False, "neveljaven nasprotnik"

#########################################

class Igra():

	def __init__(self):
		self.plosca = [['NaN' for x in range(VELIKOST)] for y in range(VELIKOST)]
		self.naPotezi = MODRI


#########################################

class Gui():

	TAG_FIGURA = 'fig'

	def __init__(self, root):
		self.plosca = Canvas(root, width=100*(VELIKOST+1), height=100*(VELIKOST+1))


#########################################

if __name__ == "__main__":

    parser = argparse.ArgumentParser(description="Igrica Hex")
    
    # parser.add_argument('--globina',
    #                     default=MINIMAX_GLOBINA,
    #                     type=int,
    #                     help='globina iskanja za minimax ali alfabeta algoritem')
    
    parser.add_argument('--debug',
                        action='store_true',
                        help='vklopi sporočila o dogajanju')

    args = parser.parse_args()

    if args.debug:
        logging.basicConfig(level=logging.DEBUG)

    root = Tk()
    root.title("Hex")
    
    aplikacija = Gui(root)

    root.mainloop()
@@ -102,9 +102,9 @@
 T = 
-6
+8
 %0AMOD
@@ -658,18 +658,17 @@
 , width=
-10
+5
 0*(VELIK
@@ -686,26 +686,1101 @@
 ght=
-100*(VELIKOST+1))%0A
+40*(VELIKOST+1))%0A%09%09self.plosca.grid(row=0, column=0)%0A%09%09self.narisiPlosco()%0A%0A%09%09self.igra = Igra()%0A%0A%09def narisiPlosco(self):%0A%09%09radij=20.%0A%09%09premik=radij*.87%0A%09%09zamik = 50.%0A%0A%09%09x1, y1 = 0, radij%0A%09%09x2, y2 = .87*radij, radij/2%0A%09%09x3, y3 = .87*radij, -radij/2%0A%09%09x4, y4 = 0 , -radij%0A%09%09x5, y5 = -.87*radij, -radij/2%0A%09%09x6, y6 = -.87*radij, radij/2%0A%09%09for y in range(0,VELIKOST):%0A%09%09%09for x in range(0,VELIKOST):%0A%09%09%09%09self.plosca.create_polygon(%5Bx1+zamik+2*x*premik+y*premik,y1+zamik+radij*1.5*y, x2+zamik+2*x*premik+y*premik, y2+zamik+radij*1.5*y, x2+zamik+2*x*premik+y*premik, y2+zamik+radij*1.5*y, x3+zamik+2*x*premik+y*premik, y3+zamik+radij*1.5*y, x3+zamik+2*x*premik+y*premik, y3+zamik+radij*1.5*y, x4+zamik+2*x*premik+y*premik, y4+zamik+radij*1.5*y, x4+zamik+2*x*premik+y*premik, y4+zamik+radij*1.5*y, x5+zamik+2*x*premik+y*premik, y5+zamik+radij*1.5*y, x5+zamik+2*x*premik+y*premik, y5+zamik+radij*1.5*y, x6+zamik+2*x*premik+y*premik, y6+zamik+radij*1.5*y%5D,     outline='black', fill='gray', width=2)%0A%0A%09def zapriOkno(self, root):%0A%09%09%22Ta metoda se pokli%C4%8De, ko uporabnik zapre aplikacijo.%22%0A%09%09root.destroy()
 %0A%0A##

Implement hexagon drawing