Skip to content

Commit

Permalink
BC25 Debugging 101
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Tristem committed Jan 12, 2016
1 parent ae0a805 commit 4bf7162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BullCowGame/FBullCowGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ FBullCowCount FBullCowGame::SubmitGuess(FString Guess)

// loop through all letters in the guess
int32 HiddenWordLength = MyHiddenWord.length();
for (int32 i = 0; i < HiddenWordLength; i++) {
for (int32 MHWChar = 0; MHWChar < HiddenWordLength; MHWChar++) {
// compare letters against the hidden word
for (int32 j = 0; j < HiddenWordLength; j++) {
for (int32 GChar = 0; GChar < HiddenWordLength; GChar++) {
// if they match then
if (Guess[i] == MyHiddenWord[i]) {
if (i == j) { // if they're in the same place
if (Guess[GChar] == MyHiddenWord[MHWChar]) {
if (MHWChar == GChar) { // if they're in the same place
BullCowCount.Bulls++; // incriment bulls
}
else {
Expand Down
Binary file modified Section_02.VC.db
Binary file not shown.

1 comment on commit 4bf7162

@AbhijitL
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe

Please sign in to comment.