Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include "time.h"
std::string egghatching()
{
ifstream f("eggs.txt");
if (f.is_open())
cout << f.rdbuf();
cout << "You stumble over a pile of eggs. You feel a need to pick one up" << endl;
system("pause");
std::string option1= "Pick one up carefully";
std::string option2= "Watch what happens";
std::vector<std::string> options={"Pick one up carefully","Watch what happens"};
std::string play = Display(options);
system("cls");
ifstream g("eggstate.txt");
if (g.is_open())
cout << g.rdbuf();
cout << "An extremely delicate egg lies in front of you"<< endl;
system("pause");
int click = 0;
while( click < 11)
{
system("cls");
ifstream l("eggstate1.txt");
if (l.is_open())
cout << l.rdbuf();
Sleep(500);
system("cls");
ifstream m("eggstate2.txt");
if (m.is_open())
cout << m.rdbuf();
Sleep(500);
click= click + 1;
}
std::vector<std::string> hatch={"Its hatching...","Maybe they're just dancing.. "};
std::string output2 = Display(hatch);
std::vector<std::string> pet={"Dog","Cat"};
srand(time(0));
int index = rand() % pet.size(); // pick a random index
std::string userpet = pet[index];
return userpet;
}