Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dices by GOOSE
#include <iostream> #include <ctime> using namespace std; int main() { srand(time(NULL)); int dice1_P = 1 + rand() % 6; int dice2_P = 1 + rand() % 6; cout << dice1_P << " и " << dice2_P << " выпало у игрока." << endl; int dice1_AI = 1 + rand() % 6; int dice2_AI = 1 + rand() % 6; cout << dice1_AI << " и " << dice2_AI << " выпало у ИИ." << endl; int P_Sum = dice1_P + dice2_P; int AI_Sum = dice1_AI + dice2_AI; if (P_Sum > AI_Sum) { if (dice1_P == dice2_P && dice1_AI == dice2_AI) cout << "У нас тут 2 дабла образовалось!" << endl; cout << "Игрок победил!" << endl; } else if (P_Sum < AI_Sum) { if (dice1_P == dice2_P && dice1_AI == dice2_AI) cout << "У нас тут 2 дабла образовалось!" << endl; cout << "ИИ победил!" << endl; } else { if (dice1_P == dice2_P && dice1_AI == dice2_AI) cout << "У нас тут 2 дабла образовалось!" << endl; cout << "Ничья!" << endl; } return 0; }
run
|
edit
|
history
|
help
0
Go discuss this code, men!
by Mr. Goose, 3 years ago
Please
log in
to post a comment.
dynamic_cast in assert Causing Error
xxx
3 sayinin toplami
timeConversion
amusing overload choice
map_file_mangling
Matrix paths right-down only, going through XY
Template float/int comparison
Template function declaration to avoid usage of template in T::template f<int>()
enable_if::type
Go discuss this code, men!
by Mr. Goose, 3 years agoPlease log in to post a comment.