A collection of C programming projects developed during the first semester of computer science studies. This repository showcases fundamental programming concepts and various console-based applications.
- Programs Overview
- Getting Started
- Compilation Instructions
- Program Descriptions
- Technologies Used
- Contributing
This repository contains 11 different C programs covering various programming concepts:
- Snake Game - A classic console-based Snake game with score tracking
- Tic Tac Toe - Two-player Tic Tac Toe game
- Hangman - Word guessing game with limited attempts
- Dice Game - Probability-based dice rolling game
- Guess Number Game - Number guessing game with hints
- Calculator - Basic arithmetic calculator with four operations (+, -, *, /)
- ASCII Converter - Character to ASCII value converter
- Temperature Converter - Temperature conversion between different units
- Pascal's Triangle - Generates Pascal's triangle patterns
- Power Functions - Mathematical power calculations
- Size of Datatypes - Displays memory sizes of different C data types
- ฮฯฮณฮฑฯฯฮทฯฮนฮฟ 9 - Laboratory exercise 9 with multiple code implementations
- GCC compiler or any C compiler
- Windows environment (some programs use Windows-specific libraries)
- Basic understanding of C programming
- Clone the repository:
git clone https://github.com/AlexBesios/First-Semester-C-Programs.git
- Navigate to the project directory:
cd First-Semester-C-Programs
Each program can be compiled using GCC. Navigate to the specific program directory and use:
gcc code.c -o program_name.exeFor programs with specific names:
gcc hangman.c -o hangman.exe
gcc ASCII.c -o ASCII.exe
gcc Dice.c -o Dice.exeAfter compilation, run the executable:
./program_name.exe- File:
Snake game/code.c - Features:
- Arrow key controls (UP, DOWN, LEFT, RIGHT)
- Score tracking and record keeping
- Food generation and collision detection
- Game over conditions
- Libraries:
stdio.h,conio.h,windows.h,time.h
- File:
Tic Tac Toe/code.c - Features: Two-player game with win condition checking
- File:
Hangman/hangman.c - Features:
- Word guessing with limited attempts (6 tries)
- Case-insensitive input handling
- Progress display with underscores
- Concepts: String manipulation, loops, conditional statements
- File:
Dice game/Dice.c - Features: Random dice rolling simulation
- File:
Guess number game/code.c - Features: Number guessing with feedback hints
- File:
Calculator/code.c - Features:
- Basic arithmetic operations (+, -, *, /)
- Double precision floating-point support
- Input validation with switch-case structure
- Concepts: Switch statements, user input handling
- File:
ASCII converter/ASCII.c - Features:
- Character to ASCII value conversion
- Continuous operation with user choice
- Input validation and case handling
- Concepts: ASCII values, loops, boolean logic
- File:
Temperature Converter/code.c - Features: Temperature unit conversions
- File:
Pascal's triangle/code.c - Features: Mathematical pattern generation
- File:
Power functions/code.c - Features: Mathematical power calculations
- File:
Size of datatypes/code.c - Features:
- Display memory sizes of C data types
- Educational tool for understanding memory allocation
- Concepts:
sizeofoperator, data types
- Language: C
- Compiler: GCC
- Platform: Windows
- Libraries Used:
stdio.h- Standard input/outputstdlib.h- Standard library functionsstring.h- String manipulationconio.h- Console input/output (Windows)windows.h- Windows APItime.h- Time functionsctype.h- Character type functions
These programs demonstrate:
- Basic I/O Operations: Reading user input and displaying output
- Control Structures: If-else statements, loops, switch-case
- Functions: Function definition and calling
- Arrays and Strings: String manipulation and array handling
- Pointers: Basic pointer usage
- Structures: Custom data types
- File Handling: Reading from and writing to files
- Memory Management: Understanding data type sizes
- Game Logic: Implementing game rules and win conditions
First-Semester-C-Programs/
โโโ ASCII converter/
โ โโโ ASCII.c
โ โโโ ASCII.exe
โโโ Calculator/
โ โโโ code.c
โ โโโ code.exe
โโโ Dice game/
โ โโโ Dice.c
โ โโโ Dice.exe
โโโ Snake game/
โ โโโ code.c
โ โโโ code.exe
โ โโโ record.txt
โโโ Hangman/
โ โโโ hangman.c
โ โโโ hangman.exe
โโโ [Other programs...]
โโโ README.md
Contributions are welcome! Feel free to:
- Report bugs
- Suggest improvements
- Add new features
- Improve documentation
- Some programs use Windows-specific libraries (
conio.h,windows.h) - Executable files (
.exe) are included for immediate testing - The
record.txtfile in Snake game stores high scores - Programs demonstrate progressively complex concepts suitable for first-semester learning
For questions or suggestions, please open an issue in this repository.
This repository serves as a learning portfolio showcasing fundamental C programming concepts and console application development.