Pseudo code : Bull Cow Cartridge
BullCowCartridge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Console/Cartridge.h"
#include "BullCowCartridge.generated.h"
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class BULLCOWGAME_API UBullCowCartridge : public UCartridge
{
GENERATED_BODY()
public:
virtual void BeginPlay() override;
virtual void OnInput(const FString& Input) override;
// Your declarations go below!
private:
FString HiddenWord;
};
|
cs |
BullCowCartridge.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Fill out your copyright notice in the Description page of Project Settings.
#include "BullCowCartridge.h"
void UBullCowCartridge::BeginPlay() // When the game starts
{
Super::BeginPlay();
// Welcoming the Player
PrintLine(TEXT("Welcometo Bull Cows!"));
PrintLine(TEXT("Guess the 4 letter word!")); // Magic Number Remove!
PrintLine(TEXT("Press enter to continue..."));
HiddenWord = TEXT("cake");
// Setting Up Game
}
void UBullCowCartridge::OnInput(const FString& Input) // When the player hits enter
{
ClearScreen();
// Checking PlayerGuess
if (Input == HiddenWord)
{
PrintLine(TEXT("You have Won!"));
}
else
{
PrintLine(TEXT("You have Lost!"));
}
// Check If Isogram
// Prompt to Guess Again
// Check Right Number of Characters
// Prompt to Guess Again
// Subtract Life
// Check if Live > 0
// If Yes GuessAgain
// Show Lives Left
// If No Show GameOver and Hiddenword?
// Prompt to Play Again, Press Enter to Play Again?
// Cehck User Input
// PlayAgian Or Quit
}
|
cs |
'⭐ Programming > C++' 카테고리의 다른 글
[C++] 문자와 문자열 (0) | 2022.03.19 |
---|---|
[C++] Boolean & Floating point 불리언과 부동소수점 (0) | 2022.03.19 |
Pre-Increment/Decrement, Post-Increment/Decrement (0) | 2022.03.10 |
Visual Studio Code 단축키 (0) | 2022.03.10 |
Ch 4.7 CircleRun (0) | 2022.03.09 |
댓글
이 글 공유하기
다른 글
-
[C++] 문자와 문자열
[C++] 문자와 문자열
2022.03.19 -
[C++] Boolean & Floating point 불리언과 부동소수점
[C++] Boolean & Floating point 불리언과 부동소수점
2022.03.19 -
Pre-Increment/Decrement, Post-Increment/Decrement
Pre-Increment/Decrement, Post-Increment/Decrement
2022.03.10 -
Visual Studio Code 단축키
Visual Studio Code 단축키
2022.03.10