Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <array>
- #include <iomanip>
- #include <iostream>
- #include "Board.h"
- int main()
- {
- Test a = Test(2);
- a.printGrid();
- system("Pause");
- }
- #ifndef TEST_H_
- #define TEST_H_
- #include <iostream>
- #include <iomanip>
- #include <array>
- class Test
- {
- public:
- Test(int c);
- char grid[5][10];
- void printGrid();
- void addToGrid(char c, int x, int y);
- };
- #endif
- #include "Test.h"
- using namespace std;
- Test::Test(int c)
- {
- for(int i = 0; i < 5; i++)
- {
- for(int j = 0; j < 10; j++)
- {
- grid[i][j] = '@';
- }
- }
- }
- void Test::printGrid()
- {
- for(int i = 0; i < 5; i++)
- {
- for(int j = 0; j < 10; j++)
- {
- cout << grid[i][j];
- }
- cout << endl;
- }
- }
- void Test::addToGrid(char c, int x, int y)
- {
- grid[y][x] = c;
- cout << c << " added to grid." << endl;
- }
Add Comment
Please, Sign In to add comment