Posts

Showing posts from July, 2021

c++ simple game project #cpp #codewithharry

 I hope you Subscribe my channel  Source code #include <iostream> #include <windows.h> using namespace std; //Created by:- skeleton programmer  // I hope you Subscribe my channel  void start() {     string name, answer;     for(int i=1; i<=1;i++){      cout<<"S"<<endl;      sleep(1);        cout<<"T"<<endl;      sleep(1);        cout<<"A"<<endl;      sleep(1);        cout<<"R"<<endl;      sleep(1);        cout<<"T"<<endl;      sleep(1);                 }     cout << "\nLet's Start the Game " << endl;     sleep(1);     cout << "Enter your name " << endl;     cin >> name;     cout <...

Source code is here

  #include <iostream> #include <cmath> #include <cstdlib> #include <ctime> using namespace std; int main (){   srand(time(0));   const int size=60;   cout << "Enter a letter to begin \n " ;   char x; cin>> x;   int position = size /2;   while (true) {     cout << "|START|" ;     for ( int i=0; i<size;i++) {       if (i == position)         cout << x;       else cout << " " ;}     cout << "|FINISH|" << endl;     int move= rand()%3 - 1;     position = position + move;     if (position <1) {cout << "You could not finish the race!" <<endl; break ;}     if (position >size-1) {cout << "Yay! You finished the race" << endl; break ;} ...