This program demonstrates file handling operations in C++.
- Write data to a file
- Read data from a file
- Append data to a file
- ofstream
- ifstream
- ios::app
Program successfully performs file operations.
##Task 2 - Snake Game Snake game implemented in C++ that runs in a console window. The player controls a snake using W, A, S, D keys to move around a grid, eat fruit, and grow longer.
** ##Feature** Snake movement with wrap‑around edges (snake reappears on opposite side). Fruit spawning at random positions. Score tracking (10 points per fruit). Growing tail as the snake eats fruit. Difficulty selection (Easy, Medium, Hard).
#Concept used nums (eDirection) for movement control. Arrays (tailX, tailY) to store snake body positions. Game loop (while (!gameOver)) for continuous play. Random number generation (rand() % width) for fruit placement. Windows API functions (SetConsoleCursorPosition) for smooth screen updates. Keyboard input handling (_kbhit() and _getch()).
Game over screen with final score.
#Output ######################
######################
Score: 0 Use W A S D keys | X to Exit