Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub fn main(){
- let mut stop:bool= false;
- loop {
- line.clear();
- stdin.read_line(&mut line).ok().unwrap();
- let arg: Vec<&str> = line.split_whitespace().collect();
- let cmd = arg[0];
- match cmd.trim() {
- "" => continue,
- "go" => {
- stop=false;
- thread::spawn(move || {
- start_search(&stop,GameState,history,Timecontrol...)
- });
- }
- "stop" => {stop=true;},
- "quit" => {
- stop=true;
- break;
- }
- _ => {
- println!("Unknown command {}", line);
- }
- }
- }
- }
- pub fn start_search(stop_reference:&bool, GameState,history,Timecontrol...){
- /* Do search stuff here...
- */
- //Has to break when stop_reference is set to true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement