-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRainGame.hpp
More file actions
133 lines (124 loc) · 4.1 KB
/
RainGame.hpp
File metadata and controls
133 lines (124 loc) · 4.1 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef __TEST_H__
#define __TEST_H__
#include <curses.h>
#include <iostream>
#include <list>
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <vector>
using namespace std;
#define STAGE1_WORD_DOWN_TIME 5
#define WORD_MAX 50
#define START_MODE 0
#define STAGE1_MODE 1
#define STAGE2_MODE 2
#define STAGE3_MODE 3
#define BOSS_MODE 4
#define STAGE1_SCORE 10
#define STAGE2_SCORE 20
#define STAGE3_SCORE 30
#define BOSS_SCORE 50
// Fruit
static char *STAGE1[] = {"Banana", "Mango", "Apple", "Watermelon",
"Orange", "Strawberry", "Durian", "Grape",
"Citrus", "Mangosteen", "Plum", "Peach",
"Pineapple", "Coconnut", "Sugarcane", "Blueberry",
"Pear", "Persimmon", "Pomegranate"};
// Music
static char *STAGE2[] = {
"You And I", "Reality", "Workerholic", "Blueming",
"Mirotic", "Yes or Yes", "Heartshaker", "IDOL",
"Travel", "Good Day", "Attention", "All falls down",
"Despacito", "Shape of you", "DINOSAUR", "UmpahUmpah",
"Viva La Vida", "What the hell", "Alone", "2002",
"Lost Stars", "Love$ick", "7rings", "Speechless",
"Handclap", "We all lie", "The Ocean", "Move Like Jagger",
"Reminiscence", "HymnForTheWeekend"};
// Discipline
static char *STAGE3[] = {"Mathemtics",
"Physics",
"Quantum Mechanics",
"Apparel study",
"Religious studies",
"Food and Nutrition",
"Quantum Physics",
"Linguistics",
"Material engineering",
"Chemistry",
"Science of law",
"Computer Science",
"Philosophy",
"Economics",
"Urban engineering",
"literature",
"Psychology",
"Korean Medicine",
"Earth science",
"Pedagogy Education",
"Astronomy",
"Medicine",
"Architecture",
"Biology",
"Archaeology",
"Mechanical engineering",
"Dentistry",
"Sociology",
"Humanities",
"Natural science"};
static char *BOSS[] = {
"Infix to Postfix", "pthread_exit()", "depth_first_search",
"Message Queue", "iterator begin()", "void signalHandler()",
"Semaphore", "Symbolic Link", "std::stack<int>",
"int mkfifo()", "sigpromask()", "DIR* opendir()"};
static int SCORE_TYPE = STAGE1_SCORE;
static int MODE = START_MODE;
static int score = 0;
static int hp = 10;
static char stageName[10];
static int BOSS_HP = 5;
static char BOSS_HP_BAR[10];
static int enter_num;
static char hp_Bar[10];
static char score_Bar[10];
static char enter_Bar[20] = " | Enter | : ";
static int input;
static pthread_mutex_t lock;
typedef struct WordNode *WordNodePointer;
typedef struct WordNode {
int row, col;
char str[WORD_MAX];
WordNodePointer up, down;
} WordNode;
class Rain {
private:
public:
pthread_t pthread = 0;
void GameComplete();
void StageChange();
void Print_UI();
void FindWords(char *str);
void *Game_Board(void *);
void Game_Start();
void Draw(int row, int col, char *str);
void Print_Words();
char **Get_Words();
void Down_Words();
WordNodePointer Initnode(void);
WordNodePointer CreateWord(char *str);
void CreateList();
void GameOver();
char *Return_Str();
char enter[30] = {0};
};
typedef void *(*THREADFUNCPTR)(void *);
char *Return_Str();
void Blank_OutputWord();
void Blank_OutputWord_All();
#endif