Skip to content

Instantly share code, notes, and snippets.

@jsam
Created January 30, 2014 16:13
Show Gist options
  • Save jsam/8712162 to your computer and use it in GitHub Desktop.
Save jsam/8712162 to your computer and use it in GitHub Desktop.
[DSTG] Zadatak 3.
TEZINE_PLOCE = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 120, -20, 20, 5, 5, 20, -20, 120, 0,
0, -20, -40, -5, -5, -5, -5, -40, -20, 0,
0, 20, -5, 15, 3, 3, 15, -5, 20, 0,
0, 5, -5, 3, 3, 3, 3, -5, 5, 0,
0, 5, -5, 3, 3, 3, 3, -5, 5, 0,
0, 20, -5, 15, 3, 3, 15, -5, 20, 0,
0, -20, -40, -5, -5, -5, -5, -40, -20, 0,
0, 120, -20, 20, 5, 5, 20, -20, 120, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]
def lokmax_rezultat(igrajer, ploca):
opp = protivnik(igrajer)
total = 0
for sq in pozicije():
if ploca[sq] == igrajer:
total += TEZINE_PLOCE[sq]
elif ploca[sq] == opp:
total -= TEZINE_PLOCE[sq]
return total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment