-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComplexotron.h
102 lines (89 loc) · 1.65 KB
/
Complexotron.h
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
// Complexotron.h
// Author: Siraj Qazi
// Complexotron v4.2
// Dated: May 29th, 2018
// Header file with Class definitions
#include <iostream>
using namespace std;
#ifndef HYDRA_CLASS
#define HYDRA_CLASS
class Hydra
{
protected:
int* instructionMemory;
int* integerMemory;
double* decMemory;
string* stringMemory;
enum Complexotron_Commands
{
READ = 10,
WRITE = 11,
READ_DECIMAL=12,
WRITE_DECIMAL=13,
LOAD = 20,
STORE = 21,
LOAD_DECIMAL=22,
STORE_DECIMAL=23,
ADD = 30,
SUBTRACT = 31,
DIVIDE = 32,
MULTIPLY = 33,
POWER = 34,
LOG = 35,
SIN = 36,
COS = 37,
TAN = 38,
GOTO = 40,
GOTO_IF_NEG = 41,
GOTO_IF_ZERO = 42,
STOP = 43,
GOTO_IF_NEG_DECIMAL=44,
GOTO_IF_ZERO_DECIMAL=45,
ADD_DECIMAL=50,
SUBTRACT_DECIMAL=51,
MULTIPLY_DECIMAL=52,
DIVIDE_DECIMAL=53,
POWER_DECIMAL=54,
READ_STRING = 70,
WRITE_STRING = 71,
STORE_STRING = 72,
EDIT=99
};
};
class Complexotron : public Hydra
{
public:
Complexotron();
void Start();
/* void debugMode()
{
enterComplexotron();
} */
private:
// Member functions
void enterComplexotron();
void enterCML();
void execute();
void CML();
void stringInput();
void loadFromFile();
void saveToFile();
void loading();
void loadedSuccessfully();
void documentation();
void showError(string);
void printStats();
void showProjectCredits();
void displayCommand(int);
void changePasswd();
// Data Members
int congregator;
double dcongregator;
int instructionMeasure;
int commandID;
int location;
int commandRgstr;
string userID;
string adminPasswd;
};
#endif