# 判断每个点的价值
def point_value(pos, white_chesses, black_chesses, identify1, identify2):
value = 0
for i in range(1,9):
# *1111_ 活四
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 4, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 5, white_chesses, black_chesses) == 0:
value += 40000
# *11112 死四1
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 4, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 5, white_chesses, black_chesses) == identify2:
value += 30000
# 1*111 死四2
if get_point(pos, i, -1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1:
value += 30000
# 11*11 死四3
if get_point(pos, i, -2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, -1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1:
value += 30000
# *111_ 活三1
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 4, white_chesses, black_chesses) == 0:
value += 20000
# *1_11_ 活三2
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 4, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 5, white_chesses, black_chesses) == 0:
value += 20000
# *1112 死三1
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 4, white_chesses, black_chesses) == identify2:
value += 15000
# _1_112 死三2
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 4, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 5, white_chesses, black_chesses) == identify2:
value += 15000
# _11_12 死三3
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 4, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 5, white_chesses, black_chesses) == identify2:
value += 15000
# 1__11 死三4
if get_point(pos, i, -1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 1, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1:
value += 15000
# 1_1_1 死三5
if get_point(pos, i, -1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1:
value += 15000
# 2_111_2 死三6
if get_point(pos, i, -1, white_chesses, black_chesses) == identify2 and \
get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 4, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 5, white_chesses, black_chesses) == identify2:
value += 15000
# __11__ 活二1
if get_point(pos, i, -1, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 3, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 4, white_chesses, black_chesses) == 0:
value += 1000
# _1_1_ 活二2
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 3, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 4, white_chesses, black_chesses) == 0:
value += 1000
# *1__
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == 0 and \
get_point(pos, i, 3, white_chesses, black_chesses) == 0:
value += 30
# *1_
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1 and \
get_point(pos, i, 2, white_chesses, black_chesses) == 0:
value += 20
# *1
if get_point(pos, i, 1, white_chesses, black_chesses) == identify1:
value += 10
return value
|