diff options
Diffstat (limited to 'src/game.rs')
| -rw-r--r-- | src/game.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game.rs b/src/game.rs index 931a15f..057a307 100644 --- a/src/game.rs +++ b/src/game.rs @@ -82,10 +82,11 @@ pub enum Action { impl fmt::Display for Action { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - Action::Place(player, pos, stone) => write!(f, "{}{}{}", pos, player, stone), + Action::Place(_, pos, stone) => write!(f, "{}{}", stone, pos), Action::Move(_, pos, direction, drops) => write!( f, - "{}{}{}", + "{}{}{}{}", + drops.iter().map(|&d| d as u32).sum::<u32>(), pos, direction, drops.into_iter().map(|q| q.to_string()).collect::<String>() @@ -244,6 +245,8 @@ enum TurnOrder { Normal, } +// TODO: Redo this logging story with Result<...,String> instead + pub struct Game<L> where L: Fn(String), |
