Generation

generate functionWed, 14 Dec 2022

tic tac toe

#include <iostream> #include <string> int main() { std::string board[3][3]; for(int y = 0; y < 3; y++){ for(int x = 0; x < 3; x++){ board[y][x] = " "; } } board[0][0] = "X"; board[0][2] = "O"; for(int y = 0; y < 3; y++){ for(int x = 0; x < 3; x++){ std::cout << board[y][x] << " "; } std::cout << "\n"; } return 0; }

Questions about programming?Chat with your personal AI assistant