From 1e21ebed15321aacbba53121cb40bbc60f4db1cc Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 8 Dec 2018 22:02:19 +0200 Subject: Renamed variable to be more concise --- src/strategy/monte_carlo.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/strategy') diff --git a/src/strategy/monte_carlo.rs b/src/strategy/monte_carlo.rs index 543d5d7..adbb911 100644 --- a/src/strategy/monte_carlo.rs +++ b/src/strategy/monte_carlo.rs @@ -2,7 +2,6 @@ use engine::command::*; use engine::status::GameStatus; use engine::bitwise_engine::{Player, BitwiseGameState}; use engine::constants::*; -use engine::geometry::*; use std::fmt; @@ -234,7 +233,7 @@ pub fn random_move(player: &Player, opponent: &Player, rng: &mut R) -> C if needs_energy && player.energy >= ENERGY_PRICE { for p in 0..NUMBER_OF_MAP_POSITIONS as u8 { let point = Point::new_index(p); - let weight = if player.occupied & point.to_either_bitfield() != 0 { + let weight = if player.occupied & point.to_bitfield() != 0 { 0 } else { 2 @@ -252,7 +251,7 @@ pub fn random_move(player: &Player, opponent: &Player, rng: &mut R) -> C let point = Point::new_index(p); let y = usize::from(point.y()); - let weight = if player.occupied & point.to_either_bitfield() != 0 || point.x() < 4 { + let weight = if player.occupied & point.to_bitfield() != 0 || point.x() < 4 { 0 } else { defence_metric_per_row[y] @@ -268,7 +267,7 @@ pub fn random_move(player: &Player, opponent: &Player, rng: &mut R) -> C if player.energy >= MISSILE_PRICE { for p in 0..NUMBER_OF_MAP_POSITIONS as u8 { let point = Point::new_index(p); - let weight = if player.occupied & point.to_either_bitfield() != 0 { + let weight = if player.occupied & point.to_bitfield() != 0 { 0 } else { let y = usize::from(point.y()); @@ -286,7 +285,7 @@ pub fn random_move(player: &Player, opponent: &Player, rng: &mut R) -> C if !cant_tesla { for p in 0..NUMBER_OF_MAP_POSITIONS as u8 { let point = Point::new_index(p); - let weight = if (player.occupied & point.to_either_bitfield() != 0) || point.y() < 7 { + let weight = if (player.occupied & point.to_bitfield() != 0) || point.y() < 7 { 0 } else { 10 -- cgit v1.2.3