Object-Oriented Tic-Tac-Toe

Medium Applied C++ OOP Mini Projects
Solve in Playground →

Problem Statement

Design an OOP Tic-Tac-Toe game using a `Board` class in C++. Process a sequence of up to 9 move coordinates (row, col) alternating ‘X’ and ‘O’, and output the winner (‘X’ or ‘O’) or ‘DRAW’ if the grid fills or the game ends. Start the game with player ‘X’.

Input Format

Up to 9 lines of 'row col' coordinates (0-indexed).

Output Format

Print winner 'X', 'O', or 'DRAW'.

Constraints

Valid non-overlapping moves 0..2

Sample Input

0 0
1 0
0 1
1 1
0 2

Sample Output

X

Explanation

X wins the top row (0,0), (0,1), (0,2).

Starter Code

#include <iostream>

class Board {
public:
    Board() {
        // Write your initialization here
    }
    bool move(int r, int c, char p) {
        // Write your logic here
        return false;
    }
    char check_winner() {
        // Write your logic here
        return 0;
    }
};

int main() {
    // Implement game loop and logic
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used