Skip to content

Instantly share code, notes, and snippets.

@limzunyuan
Created February 10, 2016 19:02
Show Gist options
  • Save limzunyuan/6f789e8f3847242a018e to your computer and use it in GitHub Desktop.
Save limzunyuan/6f789e8f3847242a018e to your computer and use it in GitHub Desktop.
void paintLine(Line *li) {
cout<<"PAINT_LINE "<<li -> p1.first <<" "<< li->p1.second <<" " <<li->p2.first<< " "<< li->p2.second<<endl;
}
void paintSquare(Square* sq) {
int x = (sq->top_left.first + sq->bottom_right.first) /2;
int y = (sq->top_left.second + sq->bottom_right.second) /2;
int len = (sq->bottom_right.first - sq->top_left.first) / 2;
cout<<"PAINT_SQUARE "<<x<<" "<<y<<" " << len <<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment