This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (bWindowDrift) { | |
windowDrift = windowDrift + .01f; | |
TestDriftDirection(windowDrift); | |
AutoMove(windowDrift); | |
} else { | |
windowDrift = windowDrift - .01f; | |
TestDriftDirection(windowDrift); | |
AutoMove(windowDrift); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
public class FadePanel : MonoBehaviour { | |
public float fadeInTime= 1f; | |
private Image fadePanel; | |
private Color currentColor = new Color(0f,0f,0f,1f); // or = Color.black; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Paddle : MonoBehaviour { | |
public AudioClip paddle; | |
private bool autoplay, begun, driftDirection, easy; | |
private Ball ball; | |
private Vector3 ballPos; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Ball : MonoBehaviour { | |
public AudioClip ball; | |
private float currentVelocityX; | |
private float currentVelocityY; | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Transform RandomFreePosition () { | |
Transform[] myEmptyChildren = new Transform[transform.childCount]; | |
int inCount = 0; | |
foreach(Transform childPosition in transform) { | |
if (childPosition.childCount == 0) { | |
myEmptyChildren[inCount] = childPosition; | |
inCount++; | |
} | |
} | |
if (inCount > 0) return myEmptyChildren[Random.Range(0, inCount)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Tic - Tac - Console | |
by: @JackDraak - Playing around: just a humble hobbyist | |
tinkerer, messing with C++ to have fun | |
and maybe even learn something. | |
This is my first working version of a one-player | |
take on the the classic pen and paper (or should I | |
say, "stick and dirt"?) game: tic - tac - toe | |
[designed to now be played on the Windows Console.] | |
Where to go from here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void GetPrimeFactors(uint64_t number) | |
{ | |
if (number == 2) | |
{ | |
primeFactors.push_back(number); | |
return; | |
} | |
int max = floor(sqrt(number)); | |
uint64_t factor; |
OlderNewer