合成AK IOI的c++版 ( 还没写完~~~ )
C++#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<ctime>
using namespace std;
string s[10][10];
void print(string x,int t)
{
for(int i = 0;i < x.size();i++)
{
putchar(x[i]);
Sleep(t);
}
}
void print_map()
{
for(int i = 1;i <= 6;i++)
{
for(int j = 1;j <= 6;j++)
{
if(s[i][j] == "")
cout << " NO";
else
cout << setw(4) << s[i][j];
}
cout << '\n';
}
}
bool do_w();
bool do_s();
bool do_a();
bool do_d();
void start()
{
srand(time(0));
char c;
int x,y;
while(true)
{
system("cls");
x = rand() % 6 + 1;
y = rand() % 6 + 1;
s[x][y] = "CE";
print_map();
c = _getch();
if(c == 'e')
break;
}
}
int main()
{
char c;
cout << " /\\ /\\ | / \n";
cout << " / \\ \\ / \\ | / \n";
cout << " / \\ \\ / \\ |/ \n";
cout << "/ \\ ---------- /------\\ | \\ \n";
cout << " ----- / \\ / \\ | \\ \n";
cout << " | | /--| \\ / \\ | \\ \n";
cout << " ----- / \\| \\| / \\ | \\ \n";
cout << " ------------------ \n";
cout << " | 按下任意键开始 | \n";
cout << " ------------------ \n";
c = _getch();
system("cls");
start();
return 0;
}