-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
3,125 additions
and
252 deletions.
There are no files selected for viewing
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
struct Date | ||
{ | ||
int day; | ||
int hour; | ||
int minute; | ||
int second; | ||
|
||
int to_seconds() | ||
{ | ||
return second + minute * 60 + hour * 60 * 60 + day * 24 * 60 * 60; | ||
} | ||
|
||
void from_seconds(int s) | ||
{ | ||
day = s / (24 * 60 * 60); | ||
s = s % (24 * 60 * 60); | ||
hour = s / (60 * 60); | ||
s = s % (60 * 60); | ||
minute = s / 60; | ||
s = s % 60; | ||
second = s; | ||
} | ||
|
||
std::string format() | ||
{ | ||
std::string str; | ||
str += std::to_string(day); | ||
str += ':'; | ||
str += std::to_string(hour); | ||
str += ':'; | ||
str += std::to_string(minute); | ||
str += ':'; | ||
str += std::to_string(second); | ||
|
||
return str; | ||
} | ||
|
||
}; |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#pragma once | ||
#include <string> | ||
|
||
class Speech | ||
{ | ||
public: | ||
|
||
static std::string positive() | ||
{ | ||
if (rand() % 2 == 0) | ||
{ | ||
if (rand() % 2 == 0) | ||
{ | ||
return "Affirmative, "; | ||
} | ||
else | ||
{ | ||
return "Received, "; | ||
} | ||
} | ||
else | ||
{ | ||
if (rand() % 2 == 0) | ||
{ | ||
return "Yes sir, "; | ||
} | ||
else | ||
{ | ||
return "Solid copy sir, "; | ||
} | ||
} | ||
} | ||
|
||
static std::string heading() | ||
{ | ||
if (rand() % 2 == 0) | ||
{ | ||
return "setting heading to the "; | ||
} | ||
else | ||
{ | ||
return "changing heading to the "; | ||
} | ||
} | ||
|
||
static std::string heading_done() | ||
{ | ||
if (rand() % 2 == 0) | ||
{ | ||
return "Heading set, sir!"; | ||
} | ||
else | ||
{ | ||
return "Sir, heading is set"; | ||
} | ||
} | ||
|
||
static std::string speed_done() | ||
{ | ||
if (rand() % 2 == 0) | ||
{ | ||
return "Velocity set, sir!"; | ||
} | ||
else | ||
{ | ||
return "Sir, we are at the target velocity"; | ||
} | ||
} | ||
}; |
Oops, something went wrong.