Skip to content

Commit 3b637bc

Browse files
committed
directory structure update
1 parent bf86aa0 commit 3b637bc

File tree

11 files changed

+305
-249
lines changed

11 files changed

+305
-249
lines changed

build/typit.exe

149 KB
Binary file not shown.

headers/participant.hpp

Lines changed: 0 additions & 78 deletions
This file was deleted.

headers/sentence.hpp

Lines changed: 0 additions & 87 deletions
This file was deleted.

include/global.hh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef GLOBAL_HH
2+
#define GLOBAL_HH
3+
4+
#include <iostream>
5+
#include <iomanip>
6+
#include <cstdlib>
7+
#include <ctime>
8+
#include <cmath>
9+
#include <vector>
10+
#include <string>
11+
#include <algorithm>
12+
using namespace std;
13+
14+
#ifdef _WIN32
15+
#include <windows.h>
16+
#define color system("Color 0A")
17+
#define clr_here system("cls")
18+
#define pause_here system("pause")
19+
#else
20+
#include <unistd.h>
21+
#define color
22+
#define clr_here system("clear")
23+
#define pause_here cout << "Press enter to continue...\n", getchar()
24+
#endif
25+
26+
#include "./participant.hh"
27+
28+
void printRoundHeader(int roundNumber);
29+
void printMainHeader();
30+
bool cmp1(participant a, participant b);
31+
bool cmp2(participant a, participant b);
32+
void showLeaderboard(vector<participant> participants, int numberOfParticipants);
33+
34+
#endif // !GLOBAL_HH

include/participant.hh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef PARTICIPANT_HH
2+
#define PARTICIPANT_HH
3+
4+
#include <iostream>
5+
#include <iomanip>
6+
#include <string>
7+
#include <vector>
8+
using namespace std;
9+
10+
class participant
11+
{
12+
private:
13+
string name = "";
14+
double totalScore = 0.0;
15+
double maxScore = 0.0;
16+
double averageAccuracy = 0.0;
17+
double averageSpeed = 0.0; //characters per second
18+
19+
public:
20+
participant(int n);
21+
void addScore(double score);
22+
void addAccuracy(double accuracy);
23+
void addSpeed(double speed);
24+
string getName();
25+
double getTotalScore();
26+
double getMaxScore();
27+
double getAverageAccuracy();
28+
double getAverageSpeed();
29+
void printName();
30+
void printTotalScore();
31+
void printMaxScore();
32+
void printAverageAccuracy();
33+
void printAverageSpeed();
34+
};
35+
36+
#endif // !PARTICIPANT_HH

include/sentence.hh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef SENTENCE_HH
2+
#define SENTENCE_HH
3+
4+
#include <iostream>
5+
#include <sstream>
6+
#include <fstream>
7+
#include <string>
8+
using namespace std;
9+
10+
#include "./global.hh"
11+
12+
class sentence
13+
{
14+
private:
15+
string s;
16+
17+
public:
18+
sentence(int difficulty);
19+
void addSentence();
20+
string getSentence();
21+
};
22+
23+
#endif // !SENTENCE_HH

0 commit comments

Comments
 (0)