I am trying to make a Tic Tac Toe random bot to play with when I am bored. I think I am doing something wrong cause when RF randomly picked a already taken place to put the piece. It wouldn't make a move so that's why I need a "else goto :AI" to make sure it picks a random available spot to put it's piece.
IF "%RF%"==%1% IF NOT "%A%"=="X" set A=O else goto :AI
IF "%RF%"==%2% IF NOT "%B%"=="X" set B=O else goto :AI
IF "%RF%"==%3% IF NOT "%C%"=="X" set C=O else goto :AI
IF "%RF%"==%4% IF NOT "%D%"=="X" set D=O else goto :AI
IF "%RF%"==%5% IF NOT "%E%"=="X" set E=O else goto :AI
IF "%RF%"==%6% IF NOT "%F%"=="X" set F=O else goto :AI
IF "%RF%"==%7% IF NOT "%G%"=="X" set G=O else goto :AI
IF "%RF%"==%8% IF NOT "%H%"=="X" set H=O else goto :AI
IF "%RF%"==%9% IF NOT "%I%"=="X" set I=O else goto :AI
Aucun commentaire:
Enregistrer un commentaire