-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
97 lines (73 loc) · 1.56 KB
/
main.cpp
File metadata and controls
97 lines (73 loc) · 1.56 KB
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
#include "helico.hpp"
#include <string.h>
// pour clearer la console
void clear_console() { system("clear"); }
// usage
void usage() {
std::cout << "Usage: testhelico\tanim file tempo\n\t\t\tmusic file\n\t\t\thelico" << std::endl;
}
int simulator();
int main(int argc, char **argv)
{
//std::system("sudo modprobe pcspkr");
if(argc > 1) {
// test helico
if(strcmp(argv[1], "helico") == 0) {
clear_console();
std::cout << " Press enter to finish " << std::endl << std::endl;
{
Helico _;
getchar();
}
}
// test animations
else if(strcmp(argv[1], "anim") == 0) {
if(argc != 4) {
usage();
return -1;
}
else {
clear_console();
std::cout << " Press enter to finish " << std::endl << std::endl;
Aquarium a(argv[2], std::stoi(argv[3]));
getchar();
}
}
else if(strcmp(argv[1], "simulator") == 0) {
clear_console();
simulator();
clear_console();
}
// test musique
else if(strcmp(argv[1], "music") == 0) {
if(argc != 3) {
usage();
return -1;
}
else {
clear_console();
std::cout << " Press enter to finish " << std::endl << std::endl;
{
MaitreGims mg(argv[2]);
getchar();
}
}
}
else {
usage();
return -1;
}
}
// demo par défaut
else {
clear_console();
usage();
std::cout << " Press enter to finish " << std::endl << std::endl;
{
Aquarium a("anim/aqua.txt", 200);
MaitreGims mg("snd/joie.txt");
getchar();
}
}
clear_console();
}