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