whoops forgot a stray file
This commit is contained in:
parent
917b377f98
commit
52015d0479
|
@ -1,38 +0,0 @@
|
||||||
#[derive(Eq, PartialEq, Clone, Copy)]
|
|
||||||
pub enum RpsHand {
|
|
||||||
Paper,
|
|
||||||
Scissors,
|
|
||||||
Rock,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl RpsHand {
|
|
||||||
pub fn loses_to(&self) -> RpsHand {
|
|
||||||
match *self {
|
|
||||||
RpsHand::Paper => RpsHand::Scissors,
|
|
||||||
RpsHand::Scissors => RpsHand::Rock,
|
|
||||||
RpsHand::Rock => RpsHand::Paper,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn wins_against(&self) -> RpsHand {
|
|
||||||
match *self {
|
|
||||||
RpsHand::Paper => RpsHand::Rock,
|
|
||||||
RpsHand::Scissors => RpsHand::Paper,
|
|
||||||
RpsHand::Rock => RpsHand::Scissors,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn ties_with(&self) -> RpsHand {
|
|
||||||
*self
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub enum Goal {
|
|
||||||
Lose,
|
|
||||||
Draw,
|
|
||||||
Win,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Eq, PartialEq)]
|
|
||||||
pub struct Game {
|
|
||||||
pub opponent: RpsHand,
|
|
||||||
pub mine: RpsHand,
|
|
||||||
}
|
|
Loading…
Reference in a new issue