-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdditionalGames.cpp
More file actions
80 lines (66 loc) · 1.93 KB
/
Copy pathAdditionalGames.cpp
File metadata and controls
80 lines (66 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "Header.h"
#include <iostream>
//This file for tavern games
void DiceRoll(Character& hero)
{
int choice;
do{
std::cout << "Choose option "<<
"1 - Play game" <<
"2 - How to play" <<
"3 - Quit" << std::endl;
std::cout <<"Your choice :" ;
std::cin>> choice;
switch(choice)
{
case '1':{
std::cout << "You sat near strangers to play DiceRoll game " << std::endl;
std::cout << "You roll the die" << std::endl;
int roll1 = rand() % 10 + 1; // Roll a ten-sided die
std::cout << "You rolled a " << roll1 << "!" << std::endl;
std::cout << "Now roll again" << std::endl;
std::cout << "You roll the die" << std::endl;
int roll2 = rand() % 10 + 1; // Roll a ten-sided die
std::cout << "You rolled a " << roll2 << "!" << std::endl;
if(roll1 <= roll2) hero.SetGold(hero.GetGold() + 10);
break;
}
case '2':
HowToPlayRollDiceFunction();
break;
case '3':
return ;
break;
default :
std::cout << "You eneteed wrong choice. Enter again "<< std::endl;
}
}
while(choice != 2);
}
void BoardGame()
{
std::cout << "You play a board game with the tavern patrons." << std::endl;
// Implement board game logic here
}
void MusicChallenge()
{
std::cout << "You participate in a music challenge with the tavern patrons." << std::endl;
// Implement music challenge logic here
}
void FistFight()
{
std::cout << "You engage in a fist fight with the tavern patrons." << std::endl;
// Implement fist fight logic here
}
void DrinkingContest()
{
std::cout << "You participate in a drinking contest with the tavern patrons." << std::endl;
// Implement drinking contest logic here
}
void HowToPlayRollDiceFunction()
{
std::cout << "\n\n===How to play RollDice game=== \n" ;
std::cout << "You throw 2 times dice "
<< "And if you hit second time more then first time or equal"
<< "You win 10 coins" << std::endl;
}