Skip to content
Commits on Source (1)
#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();
}
#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();
}
#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();
}
#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"
#include <cmath>
void show_iv(){
draw::Window& theWindow = draw::Window::getInstance();
int originX = 200;
int originY = 200;
float angle = 6 * 3.14 / 25;
for (int i = 0; i < 25; i++) {
theWindow.addShape(new draw::El(Color::Purple, originX+90*cos(angle*i), originY+90*sin(angle*i), 30, -angle*(i-2)));
}
draw::Window::WaitForAllDone();
}
int main(){
show_iv();
}
#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_v(){
draw::Window& theWindow = draw::Window::getInstance();
int originX = 200;
int originY = 200;
float angle = 12 * 3.14 / 25;
for (int i = 0; i < 26; i++) {
theWindow.addShape(new draw::El(Color::Purple, originX+110*cos(angle*i), originY+110*sin(angle*i), 30, -angle*(i-3.6)));
}
draw::Window::WaitForAllDone();
}
int main(){
show_v();
}