-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreverse7cppedition.cpp
182 lines (154 loc) · 3.79 KB
/
reverse7cppedition.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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
#ifdef _WIN32
#define clearcmd "cls"
#else
#define clearcmd "clear"
#endif
using namespace std;
void logo()
{
std::cout << " ______ " << std::endl;
std::cout << " |____ | " << std::endl;
std::cout << " _ __ _____ _____ _ __ ___ ___ / / " << std::endl;
std::cout << " | '__/ _ \\ \\ / / _ \\ '__/ __|/ _ \\ / /" << std::endl;
std::cout << " | | | __/\\ V / __/ | \\__ \\ __// / " << std::endl;
std::cout << " |_| \\___| \\_/ \\___|_| |___/\\___/_/ " << std::endl;
std::cout << " reverse7 on c++ " << std::endl;
}
void logo2()
{
std::cout << "reverse7 on c++" << std::endl;
}
void logo3()
{
std::cout << "reverseditor" << std::endl;
}
void droplet()
{
cout << "do it yourself if you dont want to wait.";
}
void clearscreen()
{
system(clearcmd);
logo2();
}
void createtextfile() {
std::string filename;
std::string contents;
std::string line;
std::cout << "enter file name (should be smth like example.extention) > ";
getline(std::cin, filename);
std::cout << "(use EOF as the ending line)\n";
while (true) {
getline(std::cin, line);
if (line == "EOF") {
break;
}
contents += line + "\n";
}
std::ofstream myfile(filename);
if (myfile.is_open()) {
myfile << contents;
myfile.close();
std::cout << "file created successfully!" << std::endl;
}
else {
std::cout << "unable to create the file" << std::endl;
}
}
void readtextfile() {
std::string line;
std::string filename;
std::cout << "enter filename > ";
getline(std::cin, filename);
std::ifstream myfile(filename);
if (myfile.is_open()) {
while (getline(myfile, line)) {
std::cout << line << '\n';
}
myfile.close();
}
else {
std::cout << "unable to open file" << std::endl;
}
}
void fuckmesideways() {
time_t t = time(NULL);
tm* timePtr = localtime(&t);
//thank you inferno for giving me this power
int seconds = (timePtr->tm_sec);
int minutes = (timePtr->tm_min);
int hrs = (timePtr->tm_hour);
cout << "current time is ";
cout << hrs << ":" << minutes << endl;
if (minutes >= 60)
{
minutes = 0;
hrs++;
}
if (hrs > 24)
{
hrs = 00;
}
}
void reverseditor()
{
logo3();
createtextfile();
}
#define rtf() readtextfile();
#define ctf() createtextfile();
#define editor() reverseditor();
int main(void)
{
cout << "initialised\n";
system(clearcmd);
logo();
while (true)
{
string command;
cout << "admin > ";
getline(cin, command);
if (command == "text create")
{
ctf();
}
if (command == "editor")
{
editor();
}
if (command == "text read")
{
rtf();
}
if (command == "clear")
{
clearscreen();
}
if (command == "clock")
{
fuckmesideways();
}
if (command == "droplet")
{
droplet();
}
if (command == "exit")
{
break;
}
if (command == "help")
{
cout << "all commands are: text create;text read;clear;clock;droplet;exit;help;editor\n";
cout << "for now editor and text create do the same thing. editor will be a small cfg editor ill prob make for reverse v2\n";
}
}
return 0;
}
// thank you inferno for helping with the clock.
// made by yours truly, stefan the fork (aka background)
// 2023 september 6th :P