This repository hosts a simple, yet complete, implementation of the classic Tic-Tac-Toe game. Developed in C, this project provides a command-line interface for two players to engage in a traditional game on a 3x3 grid. It's an excellent example for understanding basic C programming concepts, game logic, and console interaction.
- 🎯 Classic 3x3 Grid Gameplay: Experience the familiar Tic-Tac-Toe rules.
- 👥 Two-Player Mode (coming soon): Play head-to-head with a friend.
- ⌨️ Command-Line Interface: Interact with the game directly through your terminal.
- 🏆 WinDetection: Automatically identifies winning conditions (three in a row, column, or diagonal) and draw states.
- ✍️ Input Validation: Ensures players enter valid moves.
Language:
Follow these steps to get the Tic-Tac-Toe game up and running on your local machine.
You need a C compiler installed on your system.
- GCC (GNU Compiler Collection) is highly recommended. You can typically install it via your system's package manager (e.g.,
apton Ubuntu,brewon macOS, MinGW/MSYS2 on Windows).
-
Clone the repository
git clone https://github.com/undercraft2206/tic-tac-toe.git cd tic-tac-toe -
Navigate to the source directory
cd tic-tac-toe/ # Assuming source code is inside this directory
-
Compile the game Use a C compiler (like GCC) to compile the source code.
gcc -o tic-tac-toe main.c # Adjust 'main.c' if your main source file has a different nameThis command will create an executable file named
tic-tac-toe.
Once compiled, you can execute the game from your terminal.
./tic-tac-toeAfter running the executable, the game board will be displayed in your terminal. Players take turns entering a number (1-9) corresponding to the position on the grid where they wish to place their 'X' or 'O'.
Example Gameplay:
1 | 2 | 3
---+---+---
4 | 5 | 6
---+---+---
7 | 8 | 9
Player 1 (X), enter your move (1-9):
The game will continue until a player wins or all positions are filled, resulting in a draw.
tic-tac-toe/
├── tic-tac-toe/ # Contains the C source code for the game
│ └── main.c # (Assumed) The primary source file
└── README.md # Project README file
While this is a basic project, contributions are always welcome! If you have suggestions for improvements, bug fixes, or new features (e.g., AI opponent, different board sizes), please feel free to fork the repository, make your changes, and open a pull request.
- Clone the repository.
- Navigate to the
tic-tac-toedirectory. - Modify the C source files.
- Recompile using
gcc -o tic-tac-toe main.c(or your preferred compiler). - Test your changes by running
./tic-tac-toe.
This project currently has no explicit license specified. All rights are reserved by the author.
- Inspired by the timeless simplicity of the Tic-Tac-Toe game.
Made with ❤️ by undercraft2206
Calculator 2000 is a basic command-line calculator application written in C, designed to perform simple arithmetic operations such as addition, subtraction, and division. The program takes two integer values and an operator as input from the user, performs the specified operation, and displays the result. This project serves as a starting point for developers looking to create more complex calculator applications or integrate a calculator into a larger system.
- Performs addition, subtraction, and division operations
- Takes two integer values and an operator as input from the user
- Displays the result of the operation
- Simple and intuitive command-line interface
- Written in C for flexibility and portability
- Programming Language: C
- Standard Input/Output Library:
stdio.h - Compiler: GCC (or any other C compiler)
- Operating System: Linux, macOS, or Windows
To install and run the Calculator 2000 application, follow these steps:
- Install a C compiler (such as GCC) on your system
- Ensure you have a text editor or IDE to modify the code (if needed)
- Clone the repository or download the
calculator.cfile - Open a terminal or command prompt and navigate to the directory containing the file
- Compile the program using the command
gcc calculator.c -o calculator - Run the program using the command
./calculator(on Linux/macOS) orcalculator.exe(on Windows)
- Run the program and follow the prompts to input values and select an operation
- The program will display the result of the operation
calculator/
├── calculator.c
└── README.mdContributions are welcome! If you'd like to add features, fix bugs, or improve the code, please submit a pull request with your changes.
Made with ❤️ by undercraft2206
Readme with https://readmestudio.zenui.net/editor