Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- const int boardSize{ 8 };
- const int widthScale{ 2 };
- const char black{ ' ' };
- const char white{ '#' };
- bool cellColor{ false };
- int cellSize{};
- std::cout << "Enter cell size.\n";
- std::cin >> cellSize;
- for (int boardHeight{ 0 }; boardHeight < boardSize; ++boardHeight)
- {
- for (int cellHeight{ 0 }; cellHeight < cellSize; ++cellHeight)
- {
- for (int boardWidth{ 0 }; boardWidth < boardSize; ++boardWidth)
- {
- cellColor = boardWidth % 2 != boardHeight % 2;
- for (int cellWidth{ 0 }, maxCellWidth{ cellSize * widthScale }; cellWidth < maxCellWidth; ++cellWidth)
- {
- std::cout << (cellColor ? black : white);
- }
- }
- std::cout << '\n';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement