# HG changeset patch # User Neil Muller # Date 1252155609 0 # Node ID fcaae2cfe3cd1109d10fdf720d52d1f60645f430 # Parent bca2f4396de87e57c06e1a95545da180a3251f83 Make foxes less determistic when avoiding other foxes diff -r bca2f4396de8 -r fcaae2cfe3cd TODO --- a/TODO Sat Sep 05 12:51:20 2009 +0000 +++ b/TODO Sat Sep 05 13:00:09 2009 +0000 @@ -29,3 +29,5 @@ * We should have text images instead of buttons (in the various menus and toolbars). * Persistent high scores + +* Better fox move logic diff -r bca2f4396de8 -r fcaae2cfe3cd gamelib/animal.py --- a/gamelib/animal.py Sat Sep 05 12:51:20 2009 +0000 +++ b/gamelib/animal.py Sat Sep 05 13:00:09 2009 +0000 @@ -395,6 +395,9 @@ if cost < min_cost: min_cost = cost final_pos = poss + if cost == min_cost and random.randint(0, 1) > 0: + # Add some randomness in this case + final_pos = poss if not final_pos: # No good choice, so stay put return self.pos