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)] | #[derive(PartialEq, Eq)] | ||||||
| pub enum Play { | enum Play { | ||||||
|     Rock, |     Rock, | ||||||
|     Paper, |     Paper, | ||||||
|     Scissors, |     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 coup = Play::from(play); // translate to the play
 | ||||||
|     let counter = Play::from(counter_play); // translate to the play
 |     let counter = Play::from(counter_play); // translate to the play
 | ||||||
|     if coup == counter { |     if coup == counter { | ||||||
|  | @ -122,7 +122,7 @@ fn getting_score(game_output: &ResultPlay, play: Play) -> i32 { | ||||||
|     game + play_result |     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 coup = Play::from(play); | ||||||
|     let response = match strat { |     let response = match strat { | ||||||
|         'X' => ResultPlay::Loss, |         'X' => ResultPlay::Loss, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue