Last active
          December 9, 2015 21:45 
        
      - 
      
 - 
        
Save whutch/f8d34b3f5808f52a117a to your computer and use it in GitHub Desktop.  
    A Bot Land mine avoider
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | init = function () { | |
| started = false; | |
| count = 0; | |
| } | |
| update = function () { | |
| if (!started && (x != 0 || y != 0)) | |
| moveTo(0,0); | |
| else | |
| started = true; | |
| if (count == 0) { | |
| count = 5; | |
| revealMines(); | |
| } | |
| else | |
| count -= 1; | |
| if (x == 0) | |
| direction = 1; | |
| if (x == 9) | |
| direction = -1; | |
| if (!isEnemyMineAt(x + direction, y)) | |
| moveTo(x + direction, y); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment