Algorithms_in_C
1.0.0
Set of algorithms implemented in C.
|
Tic-Tac-Toe game implementation in C More...
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Functions | |
static void | singlemode () |
Implementation of game vs computer. More... | |
static void | doublemode () |
Implementation of game vs another player. More... | |
static void | placex (int m) |
Update table by placing an X More... | |
static void | place () |
Update table by placing an O More... | |
static void | placey (int e1) |
Update table by placing an O More... | |
int | checkwin () |
Implementation of win conditon checker for 'X' or 'O' whenever the table is updated. More... | |
int | main () |
Main program function. More... | |
Variables | |
static char | game_table [9] |
Tic-Tac-Toe table, so basically we are using variable 'game_table' as the table(size:3X3) and updating it regularly. | |
Tic-Tac-Toe game implementation in C
Tic-Tac-Toe Game,where the user can decide to play with the computer(single player mode) or with other user(double player mode) , the code as an array named 'game_table' which is the table and user needs to enter the position inside the array(from 1-9) where he/she wants to place 'X' or 'O' on the table.
int checkwin | ( | ) |
Implementation of win conditon checker for 'X' or 'O' whenever the table is updated.
|
static |
Implementation of game vs another player.
int main | ( | ) |
Main program function.
|
static |
Update table by placing an O
|
static |
Update table by placing an X
m | location to place X |
|
static |
Update table by placing an O
e1 | location to place O |
|
static |
Implementation of game vs computer.