game_board class might need more function but this is for now
game_board.h@2:1a54e4ed2669, 2015-12-05 (annotated)
- Committer:
- AndyTran
- Date:
- Sat Dec 05 10:23:50 2015 +0000
- Revision:
- 2:1a54e4ed2669
- Parent:
- 0:06bd2763aa53
- Child:
- 3:e21ecfae42e4
something cool
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AndyTran | 0:06bd2763aa53 | 1 | #include <iostream> |
AndyTran | 0:06bd2763aa53 | 2 | using namespace std; |
AndyTran | 0:06bd2763aa53 | 3 | |
AndyTran | 0:06bd2763aa53 | 4 | class game_board |
AndyTran | 0:06bd2763aa53 | 5 | { |
AndyTran | 0:06bd2763aa53 | 6 | private: |
AndyTran | 2:1a54e4ed2669 | 7 | //unsigned char _gameboard [6][27]; |
AndyTran | 0:06bd2763aa53 | 8 | string A_row,B_row,C_row,D_row,E_row,F_row,N_row, label; |
AndyTran | 2:1a54e4ed2669 | 9 | int _my_ship [6][6]; |
AndyTran | 0:06bd2763aa53 | 10 | public: |
AndyTran | 2:1a54e4ed2669 | 11 | game_board(){ |
AndyTran | 2:1a54e4ed2669 | 12 | int i; |
AndyTran | 2:1a54e4ed2669 | 13 | for (i = 0; i < 6; i++); |
AndyTran | 2:1a54e4ed2669 | 14 | { |
AndyTran | 2:1a54e4ed2669 | 15 | _my_ship[i][0] = 0; |
AndyTran | 2:1a54e4ed2669 | 16 | _my_ship[i][1] = 0; |
AndyTran | 2:1a54e4ed2669 | 17 | _my_ship[i][2] = 0; |
AndyTran | 2:1a54e4ed2669 | 18 | _my_ship[i][3] = 0; |
AndyTran | 2:1a54e4ed2669 | 19 | _my_ship[i][4] = 0; |
AndyTran | 2:1a54e4ed2669 | 20 | _my_ship[i][5] = 0; |
AndyTran | 2:1a54e4ed2669 | 21 | } |
AndyTran | 2:1a54e4ed2669 | 22 | }; |
AndyTran | 2:1a54e4ed2669 | 23 | void new_game_board(); // done |
AndyTran | 0:06bd2763aa53 | 24 | bool place_hit_miss_friendly (int row, int colum); //check |
AndyTran | 0:06bd2763aa53 | 25 | void place_ship(int row, int colum); //done |
AndyTran | 0:06bd2763aa53 | 26 | string get1row (int row); //done |
AndyTran | 0:06bd2763aa53 | 27 | bool looser(); //done |
AndyTran | 0:06bd2763aa53 | 28 | void place_hit_miss_enemy (int row, int colum, bool hit_miss);//done |
AndyTran | 0:06bd2763aa53 | 29 | }; |