Better visibility for functions and enum.
This commit is contained in:
parent
29956ee857
commit
10b594e479
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
#[derive(PartialEq, Eq)]
|
||||
pub enum Play {
|
||||
enum Play {
|
||||
Rock,
|
||||
Paper,
|
||||
Scissors,
|
||||
|
@ -56,7 +56,7 @@ impl Into<i32> for ResultPlay {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn round_score(play: char, counter_play: char) -> i32 {
|
||||
fn round_score(play: char, counter_play: char) -> i32 {
|
||||
let coup = Play::from(play); // translate to the play
|
||||
let counter = Play::from(counter_play); // translate to the play
|
||||
if coup == counter {
|
||||
|
@ -122,7 +122,7 @@ fn getting_score(game_output: &ResultPlay, play: Play) -> i32 {
|
|||
game + play_result
|
||||
}
|
||||
|
||||
pub fn second_strat(play: char, strat: char) -> i32 {
|
||||
fn second_strat(play: char, strat: char) -> i32 {
|
||||
let coup = Play::from(play);
|
||||
let response = match strat {
|
||||
'X' => ResultPlay::Loss,
|
||||
|
|
Loading…
Reference in a new issue