Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* a programme designed for playing 5x5 tic-tac-toe, either against the computer or another player*/
- /*Made by Ike Nnadozie Jason, student number 201275074.*/
- /*last edited on 17/02/2019*/
- //Libraries included
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- void reset_board(char (*this_board)[unsigned int Rows][unsigned int Columns]);
- void print_board(char (*this_board)[unsigned int Rows][unsigned int Columns]);
- int main(void)
- {
- int Rows, Columns = 5;
- char my_board[Rows][Columns];
- reset_board(my_board[Rows][Columns]);
- print_board(my_board[Rows][Columns]);
- }
- void reset_board(char (*this_board)[unsigned int Rows][unsigned int Columns])
- {
- int r, c;
- /* Reset board */
- for(r=0; r<Rows; r++)
- {
- for(c=0; c<Columns; c++)
- {
- this_board[r][c] = ' ';
- }
- }
- }
- void print_board(char (*this_board)[unsigned int Rows][unsigned int Columns])
- {
- int r, c;
- /* Print board */
- for(r=0; r<Rows; r++)
- {
- for(c=0; c<Columns; c++)
- {
- printf("\nthis_board[%d][%d] = %c", r, c, this_board[r][c]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement