Today and throughout this week I started learning C++. Today specifically I worked on making a “game corner” as I have dubbed it. I added Roulette to the corner and will ad hangman when I finally figure out C++ Arrays.
// Free_Friday_8_28_26.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <thread>
#include <chrono>
#include <list>
using namespace std;
int roulette() {
cout << "\nRoulette!";
int iRandom, iBet;
srand(time(NULL));
iRandom = rand() % 37;
std::cout << "\nPLACE YOUR BETS DUMBFUCK!\n";
if (!(cin >> iBet)) {
std::cout << "NOT A VALID BET! SEND TO SIBERIA!!!!";
cin.clear();
cin.ignore();
return 0;
}
if (iBet >= 0 and iBet <= 37) {
if (iBet != iRandom) {
std::cout << "YOU LOSE! SEND TO BRAZIIIIL!";
}
else if (iBet == iRandom) {
std::cout << "YOU WIN! NO SEND TO BRAZIIIIL! SEND TO GUADELAJARA INSTEAD!!!!";
}
}
else {
std::cout << "NOT A VALID BET! SEND TO SIBERIA!!!!";
}
}
int hangman() {
cout << "\nHangman!";
int randindex;
list<string> words = { "python", "developer", "hangman", "challenge", "keyboard", "function", "variable", "syntax", "iteration", "recursion", "algorithm", "exception", "package", "library", "object","inheritance", "polymorphism", "encapsulation", "debugging", "compilation"};
srand(time(NULL));
}
int main()
{
int gamechoice;
cout << "Haii! :3\n";
//wait_for_x_seconds
this_thread::sleep_for(std::chrono::milliseconds(1000));
cout << "Welcome to S's game corner\nWhat game would you like to play?\n1) Roulette\n2)Hangman" << "\n";
if (!(cin >> gamechoice)) {
cout << "\nOnly Numbers Please.";
}
if (gamechoice == 1) {
roulette();
}
else if (gamechoice == 2) {
hangman();
}
}
Here is the current code for the game corner. I will finish the code for hangman when I do finally learn arrays.
Leave a Reply