Advertisement
Guest User

othelloRunner

a guest
Nov 21st, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4.  
  5. white="$1" # the program playing white
  6. black="$2" # the program playing black
  7.  
  8.  
  9. pos="WEEEEEEEEEEEEEEEEEEEEEEEEEEEOXEEEEEEXOEEEEEEEEEEEEEEEEEEEEEEEEEEE"
  10. # compile the code first:
  11. move=`$white $pos 2 1`
  12. move=`$black $pos 2 1`
  13.  
  14.  
  15. STARTTIME=$(date +%s)
  16.  
  17. myArray=("$@")
  18.  
  19. if [ $# == 3 ] && [ "$3" == "all" ];
  20. then
  21. myArray=(2 3 4 5 6 7 8 9 10)
  22. fi
  23.  
  24.  
  25.  
  26. for arg in "${myArray[@]}";
  27. do
  28. if [ "$arg" != "$white" ] && [ "$arg" != "$black" ]
  29. then
  30. ./othelloChecker $white $black $arg
  31. fi
  32.  
  33. done
  34. ENDTIME=$(date +%s)
  35. totalTime=$(($ENDTIME - $STARTTIME))
  36.  
  37. let "minutes = totalTime/60"
  38. let "seconds = (totalTime - (60 * minutes))"
  39. echo "It took $minutes minutes $seconds seconds to check all"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement