Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void BigDraw() {
- Canvas canvas({3000, 2000});
- canvas.AddShape(ShapeType::RECTANGLE, {100, 100}, {4000, 20},
- MakeTextureSolid({3, 1000}, '*'));
- canvas.AddShape(ShapeType::ELLIPSE, {50, 50}, {30, 900},
- MakeTextureSolid({100, 100}, '&'));
- std::stringstream output;
- canvas.Print(output);
- std::string answer;
- answer.reserve(3002*2003);
- for (int i = 0; i < 3002; ++i) {
- answer.push_back('#');
- }
- answer.push_back('\n');
- for (int i = 0; i < 2000; ++i) {
- answer.push_back('#');
- for (int j = 0; j < 3000; ++j) {
- if (IsPointInEllipse({j - 50, i - 50}, {30, 900})) {
- if (i < 150) {
- answer.push_back('&');
- } else {
- answer.push_back('.');
- }
- } else if (i >= 100 && j >= 100 && j < 4100 && i < 120) {
- if (j < 103) {
- answer.push_back('*');
- } else {
- answer.push_back('.');
- }
- } else {
- answer.push_back(' ');
- }
- }
- answer.push_back('#');
- answer.push_back('\n');
- }
- for (int i = 0; i < 3002; ++i) {
- answer.push_back('#');
- }
- answer.push_back('\n');
- Assert(answer == output.str(), "Your Shape implementation draws incorrect figure");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement