Implement some more base types, including basic units. This should be much closer to final interface
This commit is contained in:
parent
51cdda821d
commit
64f9638352
9 changed files with 174 additions and 74 deletions
|
@ -1,5 +1,43 @@
|
|||
#include "board.h"
|
||||
|
||||
#include <iostream> // std::cout
|
||||
|
||||
|
||||
// Namespace for testing functions
|
||||
namespace tests
|
||||
{
|
||||
// print a board
|
||||
void debug_print( CBoard& b )
|
||||
{
|
||||
for ( unsigned int r = 0; r < b.rows; r++ )
|
||||
{
|
||||
for ( unsigned int c = 0; c < b.cols; c++ )
|
||||
{
|
||||
std::cout<<(char)(b.get(c,r));
|
||||
}
|
||||
std::cout<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Test the board data class
|
||||
void test_CBoard()
|
||||
{
|
||||
CBoard board = CBoard(10,5);
|
||||
|
||||
std::cout<<"Blank board"<<std::endl;
|
||||
board.clear();
|
||||
debug_print(board);
|
||||
|
||||
std::cout<<"Filled board"<<std::endl;
|
||||
board.fill(48);
|
||||
debug_print(board);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Main program entry point
|
||||
int main()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue