repl.it
C++

prototype for shape designing, sortof.

fork
loading
Files
  • main.cpp
main.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
#include <iostream>
#include <string>
#include <unistd.h>
using namespace std;
string Shape;
char ShapeList[50][30]{
  " _____________________ ",
  "|cube                 |",
  "|rectangular_prism    |",
  "|triangular_prism     |",
  "|octogonal_prism      |",
  "|hexagonal_prism      |",
  "|rectangular_pyramid  |",
  "|triangular_pyramid   |",
  "|_____________________|"
};
char cube[15][30]{
  " ____________________ ",
  "/|__________________/|",
  "||                  ||",
  "||                  ||",
  "||                  ||",
  "||                  ||",
  "||                  ||",
  "||                  ||",
  "||                  ||",
  "||__________________||",
  "|/__________________|/"
};
char rectangular_prism[15][50]{
  " ____________________________ ",
  "/|__________________________/|",
  "||                          ||",
  "||                          ||",
  "||                          ||",
  "||                          ||",
  "||                          ||",
  "||                          ||",
  "||__________________________||",
  "|/__________________________|/"
};
char triangular_prism[30][30]{
  "          /|L         ",
  "         / | L        ",
  "        /__|__L       ",
  "        |  |  |       ",
  "        |  |  |       ",
  "        |  |  |       ",
  "        | / L |       ",
  "        |/___L|       "
};
char triangular_pyramid[30][30]{
  "          /|L         ",
  "         / | L        ",
  "        /  |  L       ",
  "       /   |   L      ",
  "      /    |    L     ",
  "     /_____|_____L    ",
  "      L    |    /     ",
  "       L   |   /      ",
  "        L  |  /       ",
  "         L | /        ",
  "          L|/         "
};
char rectangular_pyramid[30][30]{
  "          /|L         ",
  "         / | L        ",
  "        /  |  L       ",
  "       /   |   L      ",
  "      /    |    L     ",
  "     /_____|_____L    "
};
char octogonal_prism[30][50]{
  "     _______________________  ",
  "    /          L ___________L ",
  "   |            |            |",
  "   |            |            |",
  "   |            |____________|",
  "    L__________/____________/ ",
};
char hexagonal_prism[30][50]{
  "    ________________________  ",
  "   /         L              L ",
  "  /           L______________L",
  "  L          /              / ",
  "   L________/______________/  "
};
int main() {
  cout << "Hello, welcome to Shapes, a prototype program for a shape designer, say the name of the shape and if it is available it will print. Enjoy!\n\n\n\n\n";
  while(1){
    cout << "\n\n\nWhat 3d object would you like to see? (put under score between words and no capitals. E.G. rectangular_prism. Type exit to leave, and shapelist to see shapes.)... ";
    cin >> Shape;
    if (Shape == "cube"){
      for(int i=0;i<15;i++){
        cout << cube[i] << endl;
        usleep(100000);
      }
    } else if (Shape == "rectangular_prism"){
      for(int i=0;i<10;i++){
        cout << rectangular_prism[i] << endl;
        usleep(100000);
      }
    } else if (Shape == "triangular_prism"){
      for(int i=0;i<12;i++){
        cout << triangular_prism[i] << endl;
        usleep(100000);
      }
    } else if (Shape == "triangular_pyramid"){
      for(int i=0;i<15;i++){
        cout << triangular_pyramid[i] << endl;
        usleep(100000);
      }
    } else if (Shape == "rectangular_pyramid"){
      for(int i=0;i<10;i++){
        cout << rectangular_pyramid[i] << endl;
        usleep(100000);
      }
    } else if (Shape == "octogonal_prism"){
      for(int i=0;i<10;i++){
        cout << octogonal_prism[i] << endl;
        usleep(100000);
      }
    } else if (Shape == "hexagonal_prism"){
      for(int i=0;i<10;i++){
        cout << hexagonal_prism[i] << endl;
        usleep(100000);
      }
    } else if (Shape == "shapelist"){
      for (int i=0;i<10;i++){
        cout << ShapeList[i] << endl;
        usleep(100000);
      }
    } else if (Shape == "exit"){
      usleep(1000000);
      cout << "Thankyou for using Shapes.";
      break;
    } else{
      cout << "\n\n\n\n¯\\_(ツ)_/¯ sorry that is not a registered shape." << endl;
    }
  }
  return 0;
}
Fetching token
?