Advertisement
cepxuozab

BigDrawPicture

Nov 14th, 2024
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include "canvas.h"
  2. #include "shapes.h"
  3.  
  4. #include <cassert>
  5. #include <iostream>
  6.  
  7.  
  8.  
  9.  
  10. std::unique_ptr<Texture> MakeTextureSolid(Size size, char pixel) {
  11.     Image image(size.height, std::string(size.width, pixel));
  12.     return std::make_unique<Texture>(move(image));
  13. }
  14.  
  15.  
  16.  
  17. int main() {
  18.     Canvas canvas({15, 15});
  19.     canvas.AddShape(ShapeType::RECTANGLE, {10, 10}, {40, 30},MakeTextureSolid({3, 1000}, '*'));
  20.     canvas.Print(std::cout);
  21. }
  22.  
  23. #################
  24. #               #
  25. #               #
  26. #               #
  27. #               #
  28. #               #
  29. #               #
  30. #               #
  31. #               #
  32. #               #
  33. #               #
  34. #          ***..#
  35. #          ***..#
  36. #          ***..#
  37. #          ***..#
  38. #          ***..#
  39. #################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement