Skip to content

Instantly share code, notes, and snippets.

View JackDraak's full-sized avatar

Jack Draak JackDraak

  • Canada
View GitHub Profile
if (bWindowDrift) {
windowDrift = windowDrift + .01f;
TestDriftDirection(windowDrift);
AutoMove(windowDrift);
} else {
windowDrift = windowDrift - .01f;
TestDriftDirection(windowDrift);
AutoMove(windowDrift);
}
}
@JackDraak
JackDraak / Main.cpp
Last active January 27, 2016 19:06
excerpt
// making my best effort, I think these code changes can get you the output you're looking for:
//
// there are 2 problems with the code.
// The first happens on line 34 where you execute the PLayerGetGuess function (getting input) but don't store the value.
// to fix that problem, replace line 34 with:
std::string PlayerGuess = PlayerGuessGet(); // store the PlayerGuess acquired by the PlayerGetGuess() function
// becuse you're intializing and storing this variable inside the PlayGame function, it is inaccessible outside the function, so...
// next, on line 35 you execute a function intended to print the PLayerGuess back to the console.
@JackDraak
JackDraak / Main.cpp
Created January 26, 2016 08:27
Main.cpp - I/O example
#pragma once
#include <algorithm>
#include <string>
#include "FBullCowGame.h"
// Required for UnrealEngine-friendly syntax:
using FText = std::string;
using int32 = int;
// Function prototypes, as outside class:
@JackDraak
JackDraak / Main.cpp
Created January 24, 2016 03:37
excerpt
// output - after a guess is validated, print the results: Guess# of #, Bull# Cow#
void PrintTurnSummary()
{
// TODO logic for hint "hacker" levels... 0 = neophyte (none), 1 = cowtips only, 2 = bulltips only, 3 = bulls+cows, 4(?) = exclusions
FBullCowCounts BullCowCounts = BCGame.ProcessValidGuess(BCGame.GetGuess());
FString GameWord = BCGame.GetRankedIsogram();
FString Guess = BCGame.GetGuess();
int32 GameWordLength = GameWord.length();
FString MyCowsHint = "";
FString MyBullsHint = "";