-
Notifications
You must be signed in to change notification settings - Fork 0
/
Functions.cpp
118 lines (80 loc) · 2.43 KB
/
Functions.cpp
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include <iostream>
#include <string>
#include <vector>
#include <ctime>
#include <cstdlib>
using namespace std;
// int multy(int num,int time_mul)
// {
// return(num * time_mul);
// }
// int NumberOfPlayer(int num)
// {
// int number;
// cout << "Enter the number of Player you want in game :- ";
// cin >> number;
// return (number);
// }
string names(string Players_Name = "")
{
if(Players_Name == "") {
// string names;
cout << "Enter Your Player Name :- ";
cin >> Players_Name;
}
if(Players_Name.size() > 15) {
cout << "Name is too long.\n";
return "shorty";
}
return (Players_Name);
}
string Assets (string item)
{
string asset;
cout << "What you want to assing " << "Player_1" << ".\n";
cin >> asset;
return (asset);
}
int main()
{
cout << "Welcome to the Jumaji..!\n";
char ans;
cout << "Are You Ready..? (y/n)\n";
cin >> ans;
if (ans == 'y')
{
cout << "Let Play..!\n";
int numberofplayer;
int counter = 0;
cout << "Enter the number of Player you want in game :-" ;
cin >> numberofplayer;
vector<string> playerNames;
while(counter++ < numberofplayer)
{
// string name;
// cout << "Enter Your Player Name :-";
// cin >> name;
playerNames.push_back(names());
}
cout << "Players Names in the Game:\n";
for (int x = 0; x < playerNames.size(); ++x) {
cout << "Player_" << x + 1 << ": " << playerNames[x] << "\n";
}
string playerSelection;
cout <<"Which player you want to be ?(Write That player name)\n";
cin >> playerSelection;
cout << "You are now "<< playerSelection << ".\n";
cout << "Now Lets beging...! \n";
cout << "The game wants you to choose number between 1-10 \n";
int playerInput;
cin >> playerInput;
cout << "Your choice is " << playerInput
}
// int T_no;
// cout << "Enter the number that you want to multiply that number of time\n";
// cin >> T_no;
// int no;
// cout << "Entre the number that you want to multyply with "<< T_no <<" times\n";
// cin >> no;
// cout << "here is you number " << multy(T_no,no) << ".\n";
}