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