No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Simple tic tac toe game against CPU, however, I'm printing out the results of the AI part and its coming up with some really large numbers that aren't suppose to be there. After the computer's first move, it just crashes and goes into endless loop. Where did I go wrong … |
|
[CODE]int game = 3; int ckenonum; const int hkenostore = 4; int hkeno[hkenostore]; const int ckenostore = 4; int ckeno[ckenostore] = {1,2,3,4}; bool kenopass = false; for(int hkenostore = 1; hkenostore<4; hkenostore++) { do{ cout<<"Please enter a unique number between 1 and 15 (" << hkenostore << " of 3)\n"; … |
|
I'm currently working on a project similar to that of text twist. I have a dictionary txt file which I stored into an array. I then have user input a guess, then compare the guess to the dictionary array using a for loop. Somewhere along the lines of this: [CODE]string … |
|
I'm trying to compare a string value, defined by user input, to values in a struct, so it will print out the names associated with that value. [CODE] #include <iostream> #include <string> #include <sstream> using namespace std; #define n_fencers 5 struct Fencer { string name; string weapon; int score; int … |
|
[CODE]#include <iostream> #include <Windows.h> #include <time.h> #include <iomanip> #include <string> #include <cctype> #include <algorithm> using namespace std; /*********Wallet*****************/ void blingstack(double& wallet, double& winnings, double& payoff) { if(payoff > 0) cout<< "You won $ " << winnings * payoff <<endl; wallet = wallet + (winnings * payoff); cout<<"\nYour current balance is … |