This is the part of my code where I have the floating numbers entered in my array.
Code:
#include <iostream>
using namespace std;
int main()
{int opponents, odds;
char firstcard, secondcard, handsuit;
float pokerhandoddspreflop [2][9];
pokerhandoddspreflop [0][0] = 0.2;
pokerhandoddspreflop [0][1] = 0.4;
pokerhandoddspreflop [0][2] = 0.6;
pokerhandoddspreflop [0][3] = 0.8;
This isnt all of the entries for the matrix, but it gives you an idea of what I am entering.
Here is the part where I am having the if loops run and the values displayed.
Code:
if ( opponents == 1 && firstcard == 'A' && secondcard == 'A' && handsuit == 'o' ){
odds = pokerhandoddspreflop [0][0];
}
if ( opponents == 1 && firstcard == 'A' && secondcard == 'A' && handsuit == 's' ){
odds = pokerhandoddspreflop [0][0];
cout << "Your pre-flop odds of winning with " << firstcard << secondcard << handsuit << " against " << opponents << " opponents are " << odds << " to 1" <<endl;
I thought I wrote this correctly to display the value in the matrix but I'm not sure whats going on. Any help or suggestions would be greatly appreciated. Thanks