Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def MRV_Moves(game_board):
  2. l=[]#stores xy with remaing vals
  3. for row in game_board.BoardSize:#goes thru all posibilities
  4. for column in game_board.BoardSize:
  5. if (game_board[row][column]==0):
  6. l=[[0,row,column]]+l#load tuple
  7. for x in range(1,game_board.BoardSize):
  8. game_board.set_value(row,column,x)
  9. if(game_board.check_legal()):#if move is legal add 1 to remaing vals
  10. l[0][0]+=1
  11. sorted(l)
  12. g=[]
  13. g.append(l[0][1])
  14. g.append(l[0][2])
  15. return g
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement