Loading OneA_i.cpp 0 → 100644 +20 −0 Original line number Diff line number Diff line #include <X11/X.h> #include "GUI/Window.h" #include "Shapes/Line.h" #include "Shapes/Rect/Rect.h" #include "Shapes/El/El.h" #include "Shapes/El/RotatingEl.h" #include "Shapes/El/MovingEl.h" #include "Shapes/El/BoundedMovingRotatingEl.h" #include "Shapes/El/RotatingSensingEl.h" #include "Shapes/El/BlinkingMovingEl.h" void show_i(){ draw::Window& theWindow = draw::Window::getInstance(); theWindow.addShape(new draw::Line(Color::Red, 0, 400, 600, 0)); draw::Window::WaitForAllDone(); } int main(){ show_i(); } OneA_i.png 0 → 100644 +6.62 KiB Loading image diff... OneA_ii.cpp 0 → 100644 +36 −0 Original line number Diff line number Diff line #include <X11/X.h> #include "GUI/Window.h" #include "Shapes/Line.h" #include "Shapes/Rect/Rect.h" #include "Shapes/El/El.h" #include "Shapes/El/RotatingEl.h" #include "Shapes/El/MovingEl.h" #include "Shapes/El/BoundedMovingRotatingEl.h" #include "Shapes/El/RotatingSensingEl.h" #include "Shapes/El/BlinkingMovingEl.h" void show_ii() { draw::Window& theWindow = draw::Window::getInstance(); for (int i = 0; i < 8; i++) { for (int j = 0; j < 12; j++) { if ((i+j) % 2 == 0) { theWindow.addShape(new draw::Line(Color::Green, j*50, 50*i, 50*(j+1), 50*i)); theWindow.addShape(new draw::Line(Color::Green, j*50, 50*i, 50*j, 50*(i+1))); theWindow.addShape(new draw::Rect(Color::Green, 50*j+10, 50*i+10, 50*j+40, 50*i+40)); theWindow.addShape(new draw::Rect(Color::Green, 50*j+20, 50*i+20, 50*j+30, 50*i+30)); } else if ((i+j) % 2 == 1) { theWindow.addShape(new draw::Line(Color::Red, j*50, 50*i, 50*(j+1), 50*i)); theWindow.addShape(new draw::Line(Color::Red, j*50, 50*i, 50*j, 50*(i+1))); theWindow.addShape(new draw::Rect(Color::Red, 50*j+10, 50*i+10, 50*j+40, 50*i+40)); theWindow.addShape(new draw::Rect(Color::Red, 50*j+20, 50*i+20, 50*j+30, 50*i+30)); } } } draw::Window::WaitForAllDone(); } int main(){ show_ii(); } OneA_ii.png 0 → 100644 +7.76 KiB Loading image diff... OneA_iii.cpp 0 → 100644 +23 −0 Original line number Diff line number Diff line #include <X11/X.h> #include "GUI/Window.h" #include "Shapes/Line.h" #include "Shapes/Rect/Rect.h" #include "Shapes/El/El.h" #include "Shapes/El/RotatingEl.h" #include "Shapes/El/MovingEl.h" #include "Shapes/El/BoundedMovingRotatingEl.h" #include "Shapes/El/RotatingSensingEl.h" #include "Shapes/El/BlinkingMovingEl.h" void show_iii(){ draw::Window& theWindow = draw::Window::getInstance(); for (int i = 0; i < 7; i++) { theWindow.addShape(new draw::El(Color::Yellow, 550-i*50, 50+i*50, 50)); } draw::Window::WaitForAllDone(); } int main(){ show_iii(); } Loading
OneA_i.cpp 0 → 100644 +20 −0 Original line number Diff line number Diff line #include <X11/X.h> #include "GUI/Window.h" #include "Shapes/Line.h" #include "Shapes/Rect/Rect.h" #include "Shapes/El/El.h" #include "Shapes/El/RotatingEl.h" #include "Shapes/El/MovingEl.h" #include "Shapes/El/BoundedMovingRotatingEl.h" #include "Shapes/El/RotatingSensingEl.h" #include "Shapes/El/BlinkingMovingEl.h" void show_i(){ draw::Window& theWindow = draw::Window::getInstance(); theWindow.addShape(new draw::Line(Color::Red, 0, 400, 600, 0)); draw::Window::WaitForAllDone(); } int main(){ show_i(); }
OneA_ii.cpp 0 → 100644 +36 −0 Original line number Diff line number Diff line #include <X11/X.h> #include "GUI/Window.h" #include "Shapes/Line.h" #include "Shapes/Rect/Rect.h" #include "Shapes/El/El.h" #include "Shapes/El/RotatingEl.h" #include "Shapes/El/MovingEl.h" #include "Shapes/El/BoundedMovingRotatingEl.h" #include "Shapes/El/RotatingSensingEl.h" #include "Shapes/El/BlinkingMovingEl.h" void show_ii() { draw::Window& theWindow = draw::Window::getInstance(); for (int i = 0; i < 8; i++) { for (int j = 0; j < 12; j++) { if ((i+j) % 2 == 0) { theWindow.addShape(new draw::Line(Color::Green, j*50, 50*i, 50*(j+1), 50*i)); theWindow.addShape(new draw::Line(Color::Green, j*50, 50*i, 50*j, 50*(i+1))); theWindow.addShape(new draw::Rect(Color::Green, 50*j+10, 50*i+10, 50*j+40, 50*i+40)); theWindow.addShape(new draw::Rect(Color::Green, 50*j+20, 50*i+20, 50*j+30, 50*i+30)); } else if ((i+j) % 2 == 1) { theWindow.addShape(new draw::Line(Color::Red, j*50, 50*i, 50*(j+1), 50*i)); theWindow.addShape(new draw::Line(Color::Red, j*50, 50*i, 50*j, 50*(i+1))); theWindow.addShape(new draw::Rect(Color::Red, 50*j+10, 50*i+10, 50*j+40, 50*i+40)); theWindow.addShape(new draw::Rect(Color::Red, 50*j+20, 50*i+20, 50*j+30, 50*i+30)); } } } draw::Window::WaitForAllDone(); } int main(){ show_ii(); }
OneA_iii.cpp 0 → 100644 +23 −0 Original line number Diff line number Diff line #include <X11/X.h> #include "GUI/Window.h" #include "Shapes/Line.h" #include "Shapes/Rect/Rect.h" #include "Shapes/El/El.h" #include "Shapes/El/RotatingEl.h" #include "Shapes/El/MovingEl.h" #include "Shapes/El/BoundedMovingRotatingEl.h" #include "Shapes/El/RotatingSensingEl.h" #include "Shapes/El/BlinkingMovingEl.h" void show_iii(){ draw::Window& theWindow = draw::Window::getInstance(); for (int i = 0; i < 7; i++) { theWindow.addShape(new draw::El(Color::Yellow, 550-i*50, 50+i*50, 50)); } draw::Window::WaitForAllDone(); } int main(){ show_iii(); }