Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. pub fn main(){
  2. let mut stop:bool= false;
  3. loop {
  4. line.clear();
  5. stdin.read_line(&mut line).ok().unwrap();
  6. let arg: Vec<&str> = line.split_whitespace().collect();
  7. let cmd = arg[0];
  8. match cmd.trim() {
  9. "" => continue,
  10. "go" => {
  11. stop=false;
  12. thread::spawn(move || {
  13. start_search(&stop,GameState,history,Timecontrol...)
  14. });
  15. }
  16. "stop" => {stop=true;},
  17. "quit" => {
  18. stop=true;
  19. break;
  20. }
  21. _ => {
  22. println!("Unknown command {}", line);
  23. }
  24. }
  25. }
  26. }
  27.  
  28.  
  29. pub fn start_search(stop_reference:&bool, GameState,history,Timecontrol...){
  30. /* Do search stuff here...
  31. */
  32. //Has to break when stop_reference is set to true
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement