-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnakeMap.cpp
More file actions
53 lines (42 loc) · 875 Bytes
/
Copy pathSnakeMap.cpp
File metadata and controls
53 lines (42 loc) · 875 Bytes
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
/*
* =====================================================================================
*
* Filename: Map.cpp
*
* Description:
*
* Version: 1.0
* Created: 2012/3/29 ÐÇÆÚËÄ 9:38:40
* Revision: none
* Compiler: gcc
*
* Author: Python (),
* Company:
*
* =====================================================================================
*/
#include "SnakeMap.h"
#include <iostream>
using namespace std;
SnakeMap::SnakeMap() {
for(int i = 0 ; i != M ; ++i) {
for(int j = 0 ; j != N ; ++j) {
if(i == 0 || i == M - 1 || j == 0 ||j == N - 1) {
map[i][j] = "*";
}
else {
map[i][j] = " ";
}
}
}
}
SnakeMap::~SnakeMap() {
}
void SnakeMap::print() {
for(int i = 0 ; i != M ; ++i) {
for(int j = 0 ; j != N ; ++j) {
cout<<map[i][j]<<" ";
}
cout<<endl;
}
}