-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
65 lines (60 loc) · 1.81 KB
/
main.cpp
File metadata and controls
65 lines (60 loc) · 1.81 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
//
// main.cpp
// Concraft
//
// Created by Ninter6 on 2023/5/20.
//
#include <iostream>
#define MATHPLS_DIFINITION
#include "mathpls.h"
#include "World.hpp"
int main(int argc, const char * argv[]) {
ios::sync_with_stdio(false);
cout<<"请选择..."<<endl<<"1.新建世界"<<endl<<"2.加载存档"<<endl;
int opt;
cin >> opt;
switch (opt) {
case 1:{
getchar(); // 丢掉一次换行
cout<<"请输入种子(留空随机): ";
string seed;
getline(cin, seed);
if(seed.size() == 0) seed = to_string(time(nullptr));
cout<<"请输入世界大小(100~1000):"<<endl;
int x, y;
cout<<"长: ";
cin>>x;
cout<<"宽: ";
cin>>y;
x = mathpls::mid(100, x, 1000);
y = mathpls::mid(100, y, 1000);
World world(x, y, seed);
world.Play();
break;
}
case 2:{
cout<<"请输入存档路径: ";
string path;
cin>>path;
World world(path);
world.Play();
break;
}
default:
cout<<"你在干什么啊?"<<endl;
break;
}
// for(int r = 0; r < 6; r++)
// for(int g = 0; g < 6; g++)
// for(int b = 0; b < 6; b++){
// std::stringstream formatter;
// formatter << r << g << b << ": " << "\033[38;5;"<<16+36*r+6*g+b<<"m" << "Hello world!" << "\033[0m" << endl;
// std::cout << formatter.str();
// }
// for(int i=0;i<256;i++){
// std::stringstream formatter;
// formatter << i << ": " << "\033[38;5;"<<i<<"m" << "Hello world!" << "\033[0m" << endl;
// std::cout << formatter.str();
// }
return 0;
}