j0h

brick

j0h
Apr 19th, 2022 (edited)
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void lay(int height, int width, int length, int depth );
  4. void brick(int height, int width);
  5. void head();
  6. int main(){
  7. int width=1;
  8. int height=1;
  9. int length=1;
  10. int depth=1;
  11. //just make bricks red in strig output, and stoke width 1 for now
  12. cout << " input brick width " ;
  13. cin >> width;
  14. cout << "\n input brick height ";
  15. cin >> height;
  16. cout << "\n input how many bricks long ";
  17. cin >> length;
  18. cout << " input depth of bricks ";
  19. cin >> depth;
  20. head();
  21. lay( height, width, length, depth); //output da bricks
  22.  
  23.  
  24. return 0;
  25. }
  26.  
  27. void head(){
  28. cout << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n";
  29. cout << "<svg\n ";
  30. cout << " xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n";
  31. cout << " xmlns:cc=\"http://creativecommons.org/ns#\"\n";
  32. cout <<" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
  33. cout << " xmlns:svg=\"http://www.w3.org/2000/svg\"\n";
  34. cout << " xmlns=\"http://www.w3.org/2000/svg\"\n";
  35. cout << " id=\"svg8\"\n";
  36. cout << " version=\"1.1\"\n";
  37. cout << " viewBox=\"0 0 300 300\"\n";
  38. cout << " height=\"100%\"\n";
  39. cout << " width=\"100%\">\n";
  40. }
  41.  
  42. void lay(int height, int width, int length, int depth ){
  43. float halfBrick = width/2;
  44. //x+=x for n length
  45. //y+=y for n depth
  46. //for every other line, insert off
  47. int x=0;
  48. int y=0;
  49. /*
  50. * <rect
  51. y="0.5"
  52. x="0.5"
  53. height="20.338984"
  54. width="64.406776"
  55. id="rect817"
  56. style="fill:#000000; fill-opacity:0; stroke:#ff0000; stroke-width:1; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1"
  57. * /> // end rectangle
  58. * */
  59.  
  60. for(;x<length; x+=width){ //length
  61. cout << "<rect"<< endl;
  62. cout << "\"y="<< y << "\""<< endl;
  63. cout << "\"x="<< x << "\""<< endl;
  64. cout << "height=\"" << height <<"\"" << endl;
  65. cout << "width=\""<< width<< "\""<< endl;
  66. cout << "id=\"rect817\""<< endl;
  67. cout << "style=\"fill:#000000; fill-opacity:0; stroke:#ff0000; stroke-width:1; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1\"" << endl ;
  68. cout << "/>"<< endl; //end rectangle
  69.  
  70. }
  71. cout << "</svg>" << endl; //end svg
  72. }
  73.  
  74.  
  75.  
Add Comment
Please, Sign In to add comment