def hill_climbling_first_choice(status):
'''??????????????????????????????????????
??????????
'''
global chess_status_count
pos = [(x, y) for x in range(8) for y in range(8)]
random.shuffle(pos)
for col, row in pos:
if status[col] == row:
continue
chess_status_count += 1
status_copy = list(status)
status_copy[col] = row
if get_num_of_conglict(status_copy) < get_num_of_conglict(status):
status[col] = row
return status
return status
评论列表
文章目录