summaryrefslogtreecommitdiff
path: root/src/strategy/monte_carlo.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-12-08 22:02:19 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-12-08 22:02:19 +0200
commit1e21ebed15321aacbba53121cb40bbc60f4db1cc (patch)
tree1d0f07ce61e138c717b96b9692bc2329bb590dd1 /src/strategy/monte_carlo.rs
parentf6611aab7c696520d9be5dfe29303fd6e0ade0d7 (diff)
Renamed variable to be more concise
Diffstat (limited to 'src/strategy/monte_carlo.rs')
-rw-r--r--src/strategy/monte_carlo.rs9
1 files changed, 4 insertions, 5 deletions
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<R: Rng>(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<R: Rng>(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<R: Rng>(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<R: Rng>(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