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.60 KB | None | 0 0
  1.  
  2. def MRV_Moves(game_board):
  3. l=[]#stores xy with remaing vals
  4. for row in range(0,game_board.BoardSize):#goes thru all posibilities
  5. for column in range(0,game_board.BoardSize):
  6. if (game_board[row][column]==0):
  7. l=[[0,row,column]]+l#load tuple
  8. for x in range(1,game_board.BoardSize):
  9. game_board.set_value(row,column,x)
  10. if(game_board.check_legal()):#if move is legal add 1 to remaing vals
  11. l[0][0]+=1
  12. sorted(l)
  13. g=[]
  14. g.append(l[0][1])
  15. g.append(l[0][2])
  16. return g
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement