whoops forgot a stray file

This commit is contained in:
Thorn Avery 2022-12-06 10:38:54 +11:00
parent 917b377f98
commit 52015d0479

View file

@ -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,
}