swag
Dependencies: Motor Servo mbed_tictactoe
Diff: main.cpp
- Revision:
- 5:e6f9086e0730
- Parent:
- 4:6342714f3bc3
- Child:
- 6:2e621e78ab77
diff -r 6342714f3bc3 -r e6f9086e0730 main.cpp --- a/main.cpp Mon Oct 26 11:54:33 2015 +0000 +++ b/main.cpp Mon Oct 26 12:15:16 2015 +0000 @@ -49,8 +49,8 @@ //User Selects Difficulty printf("Select Difficulty\n"); int difficulty; - scanf("%d",&difficulty); - /* + //scanf("%d",&difficulty); + while(in[0]+in[1]+in[2]+in[3]!=1) { } if(in[0]==1) @@ -63,7 +63,7 @@ difficulty=4; lights[difficulty-1]=1; - */ + //Random Seed timer.stop(); srand(timer.read_us()); @@ -81,15 +81,15 @@ //Loops of turns until someone wins or a tie if(playerchip==1) { printf("You go first\n"); - //player(playerchip); - playerpc(playerchip); + player(playerchip); + //playerpc(playerchip); } while(true) { ai(aichip,difficulty); if(winner()!=-1) break; - //player(playerchip); - playerpc(playerchip); + player(playerchip); + //playerpc(playerchip); } //Operates LED's based on winner