This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
pub enum Operator { | |
Add, | |
Subtract, | |
Multiply, | |
Divide, | |
} | |
// TODO create an object that store state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class App { | |
public static void main(String[] args) { | |
GuessTheNumber guessTheNumber = new GuessTheNumber(); | |
guessTheNumber.main(args); | |
} | |
} | |
public class GameConfig { | |
public static final int MAX_ATTEMPTS = 10; | |
public static final int MAX_NUMBER = 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro_rules! do_loop {( | |
$body:block while $cond:expr | |
) => ({ | |
let mut first = true; | |
while ::core::mem::replace(&mut first, false) || $cond | |
$body | |
})} | |
let mut x = 6; | |
do_loop!({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use std::sync::Mutex; | |
use std::thread; | |
use std::time::Duration; | |
fn main() { | |
let mut handles = vec![]; | |
let fifty_millis = Duration::from_millis(50); | |
let forty_millis = Duration::from_millis(40); | |
let twenty_millis = Duration::from_millis(20); | |
let time_printing_underscore = Duration::from_secs(10); |