Lowest price ever! Learn Generative AI for 48% less!
Get my discount
+ 1

let's calculate the mine game odd

hey savey people it's Danni, i was wondering to calculate the winning amount of the mine bet game and i just triend my best to calculate, unfortunately it did not work. so guys need help to complete this code. their is 25 boxes and we choose 2 mines option to bet the game/ it's user defined their is also amount of touches that we will made/ that's also user defined. for example i bet using $3 after 5 touches my bet amount balance will be twice (winning/2x), so what was the odd of each box/25 of them. even i don't think those 25 boxes have an odds because 3 of those are already 0/bomb odds after that we already touched 5 boxes those boxes have 2x odd my question is how much odd do the remaining boxes have https://sololearn.com/compiler-playground/cxgnpvj8pF3g/?ref=app

17th Dec 2023, 8:55 PM
Noob Coder
Noob Coder - avatar
6 Answers
+ 1
Daniel Teshome 卂ㄚㄩ丂卄 's answer is actually pretty sensible. it gives you your winnings if you played a perfect game. assuming it's some kind of a minesweeper game with no hints, this is how I would calculate the odds of picking a bomb would be (the odds of winning would be 1-odds): #include <iostream> using namespace std; int main() { float mines{2}; cout<<"There are " <<mines<<" mines. Good luck.\n\n"; float minefield{25}; //odds of touching a mine as the minefield gets smaller and smaller for(int i=0;i<25;i++){ cout<<"try: "<<i<<' ' <<"minefield: " <<minefield<<'\n'; float odds{mines/minefield}; if(odds>=1){ cout<<"you ded.\n"; break; } cout<<"\todds: "<<odds<<'\n'; minefield--; }
19th Dec 2023, 3:49 AM
Bob_Li
Bob_Li - avatar
+ 1
ok, maybe it's more complicated... https://www.wikihow.com/Calculate-Odds
19th Dec 2023, 9:17 AM
Bob_Li
Bob_Li - avatar
+ 1
The CompTIA CSO-002 exam is a comprehensive certification designed to assess a candidate's proficiency in cybersecurity. It covers a range of domains crucial for effective cybersecurity management. https://www.marks4sure.com/CS0-002-exam.html
19th Dec 2023, 11:16 AM
williamanderson
0
It seems like you're trying to calculate the total winning amount in a mine bet game based on the number of mines, bet amount, and touches. However, there are some issues in your code, particularly in the calculation of mineBox and the odd calculation for the remaining boxes. Here's a modified version of your code: ```cpp #include <iostream> using namespace std; int main() { double touches, bet, mines, winning; int totalBoxes = 25; cout << "Enter the number of mines: "; cin >> mines; // Calculate the number of mine boxes int mineBoxes = mines; cout << "Enter the number of bet: "; cin >> bet; cout << "Enter the number of touches: "; cin >> touches; // Calculate the total winning amount winning = (totalBoxes - mineBoxes) * bet * touches; cout << "Total winning: " << winning << endl; return 0; } ``` In this modified code, I've changed the calculation of mineBoxes to directly assign the number of mines entered by the user. Additionally, I've adjuste
18th Dec 2023, 4:53 AM
卂ㄚㄩ丂卄
卂ㄚㄩ丂卄 - avatar
0
卂ㄚㄩ丂卄 it seems like gpt code
18th Dec 2023, 6:01 PM
Noob Coder
Noob Coder - avatar
0
Bob_Li Nah bruh
19th Dec 2023, 8:34 AM
Noob Coder
Noob Coder - avatar