Compare commits

..
4 Commits
Author SHA1 Message Date
Justin f0daf29917 Changed the print to static 2025-05-11 10:43:37 -05:00
Justin 5855b37c6e Added the type in to the print 2025-05-11 10:39:58 -05:00
Justin b7ad0fbb6c Added clear screen to the main before its starts. 2025-05-11 10:27:25 -05:00
Justin 1673e995a6 Working on the delay and fixing issues 2025-05-11 10:24:48 -05:00
9 changed files with 46 additions and 50 deletions

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ using namespace std;
class Intro { class Intro {
public: public:
static void mainIntro(); void mainIntro();
private: private:
}; };
+5 -2
View File
@@ -1,5 +1,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <thread>
#include <cstring>
using namespace std; using namespace std;
class Print{ class Print{
@@ -10,7 +12,8 @@ class Print{
~Print(){ ~Print(){
}; };
void printl(string text); static void printl(string text);
void println(string text); static void println(string text);
static void type(string text);
}; };
+1 -6
View File
@@ -1,13 +1,8 @@
#include <chrono> #include <chrono>
#include <string>
#include <iostream>
#include <cstring>
#include <thread>
using namespace std; using namespace std;
class Sleep{ class Sleep{
public: public:
static void delay(int milliseconds); static void delay(int milliseconds);
static void type(string text);
}; };
+1 -3
View File
@@ -1,12 +1,10 @@
#include <iostream> #include <iostream>
#include <unistd.h> #include <unistd.h>
#include "include/print.h"
#include "include/sleep.h"
using namespace std; using namespace std;
class Title{ class Title{
private: private:
protected: protected:
public: public:
static void mainTitle(); void mainTitle();
}; };
+2 -8
View File
@@ -1,12 +1,6 @@
#include "include/intro.h" #include "include/intro.h"
void Intro::mainIntro(){ void Intro::mainIntro(){
int time = 1000; cout << "The world didn't end with a bang. It ended with a groan.. and the scratching of death fingers against steel shutters." << endl;
cout << endl; std::this_thread::sleep_for(std::chrono::milliseconds(3000));
cout << endl;
Sleep::type("");
Sleep::delay(time);
Sleep::type("The world didn't end with a bang. It ended with a groan.. and the scratching of death fingers against steel shutters.");
Sleep::delay(time);
Sleep::type("Pete used to sell shotgun, slug, and survival tips to deer hunters and doomsday preppers out of his rundown gun store ");
} }
+4 -2
View File
@@ -2,7 +2,9 @@
int main (){ int main (){
system("clear"); system("clear");
Title::mainTitle(); Title title;
Intro::mainIntro(); title.mainTitle();
Intro intro;
intro.mainIntro();
return 0; return 0;
} }
+18 -1
View File
@@ -1,9 +1,26 @@
#include "include/print.h" #include "include/print.h"
void Print::printl(string text){ void Print::printl(string text){
cout << text; cout << text << flush;
} }
void Print::println(string text){ void Print::println(string text){
cout << text << endl; cout << text << endl;
} }
void Print::type(string text){
int a = text.size();
char* charArray = new char[a+1];
strcpy(charArray, text.c_str());
int i = 0;
int time = 300;
while(i < a+1){
std::this_thread::sleep_for(std::chrono::milliseconds(time));
cout << charArray[i] << flush;
i++;
}
cout << endl;
delete[] charArray;
}
-15
View File
@@ -8,18 +8,3 @@ void Sleep::delay(int milliseconds){
// Do nothing, just wait // Do nothing, just wait
} }
} }
void Sleep::type(string text){
int a = text.size();
char* charArray = new char[a+1];
strcpy(charArray, text.c_str());
int i = 0;
int time = 300;
while(i < a+1){
std::this_thread::sleep_for(std::chrono::milliseconds(time));
cout << charArray[i] << flush;
i++;
}
cout << endl;
delete[] charArray;
}
+14 -12
View File
@@ -1,18 +1,20 @@
#include "include/title.h" #include "include/title.h"
#include "include/print.h"
#include "include/sleep.h"
void Title::mainTitle(){ void Title::mainTitle(){
int time = 700; int s = 900;
cout << "███████╗██╗ ██╗ ██████╗ ████████╗ ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███████╗████████╗███████╗" << endl; Print::println("███████╗██╗ ██╗ ██████╗ ████████╗ ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███████╗████████╗███████╗");
Sleep::delay(time); Sleep::delay(s);
cout << "██╔════╝██║ ██║██╔═══██╗╚══██╔══╝██╔════╝ ██║ ██║████╗ ██║ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝" << endl; Print::println("██╔════╝██║ ██║██╔═══██╗╚══██╔══╝██╔════╝ ██║ ██║████╗ ██║ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝");
Sleep::delay(time); Sleep::delay(s);
cout << "███████╗███████║██║ ██║ ██║ ██║ ███╗██║ ██║██╔██╗ ██║ ██████╔╝█████╗ ██║ █████╗ " << endl; Print::println("███████╗███████║██║ ██║ ██║ ██║ ███╗██║ ██║██╔██╗ ██║ ██████╔╝█████╗ ██║ █████╗ ");
Sleep::delay(time); Sleep::delay(s);
cout << "╚════██║██╔══██║██║ ██║ ██║ ██║ ██║██║ ██║██║╚██╗██║ ██╔═══╝ ██╔══╝ ██║ ██╔══╝ " << endl; Print::println("╚════██║██╔══██║██║ ██║ ██║ ██║ ██║██║ ██║██║╚██╗██║ ██╔═══╝ ██╔══╝ ██║ ██╔══╝ ");
Sleep::delay(time); Sleep::delay(s);
cout << "███████║██║ ██║╚██████╔╝ ██║ ╚██████╔╝╚██████╔╝██║ ╚████║ ██║ ███████╗ ██║ ███████╗" << endl; Print::println("███████║██║ ██║╚██████╔╝ ██║ ╚██████╔╝╚██████╔╝██║ ╚████║ ██║ ███████╗ ██║ ███████╗");
Sleep::delay(time); Sleep::delay(s);
cout << "╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝ ╚══════╝" << endl; Print::println("╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝ ╚══════╝");
} }