No older revisions available
No older revisions available
~cpp
from Player import Player
class Namsang(Player):
def __init__(self, aStone, aBoard):
Player.__init__(self, aStone, aBoard)
self.priority = [[100,0,50,10,10,50,0,100],
[0,0,40,15,15,40,0,0],
[50,40,50,10,10,50,40,50],
[10,15,10,0,0,10,15,10],
[10,15,10,0,0,10,15,10],
[50,40,50,10,10,50,40,50],
[0,0,40,15,15,40,0,0],
[100,0,50,10,10,50,0,100]]
def name(self): return "Namsang"
def execute(self):
posList = self.getPutableList()
maxValue = -1
maxPosX = -1
maxPosY = -1
for i in range(len(posList)):
posx, posy = posList[i]
if maxValue < self.priority[posx][posy] :
maxValue = self.priority[posx][posy]
maxPosX = posx
maxPosY = posy
return self.put(maxPosX, maxPosY)