Skip to content

abhinavparashri/Codtech-Internship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Task 1 - File Handling Tool (C++)

Description

This program demonstrates file handling operations in C++.

Features

  • Write data to a file
  • Read data from a file
  • Append data to a file

Concepts Used

  • ofstream
  • ifstream
  • ios::app

Output

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 ######################

F

O

######################

Score: 0 Use W A S D keys | X to Exit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages