Exemplo n.º 1
0
  /** Test client. */
  public static void main(String[] args) {

    // set the scale of the coordinate system
    StdDraw.setXscale(0, 10);
    StdDraw.setYscale(0, 10);

    // Draw line
    StdDraw.line(1, 1, 8, 8);

    // Draw square
    StdDraw.setPenColor(StdDraw.RED);
    StdDraw.setPenRadius(.01);
    StdDraw.square(3, 3, 2);

    // Draw filled Square
    StdDraw.setPenColor(StdDraw.BLUE);
    StdDraw.filledSquare(5, 8, 2);

    // Draw Circle
    StdDraw.setPenColor(StdDraw.BLACK);
    StdDraw.setPenRadius();
    StdDraw.circle(5, 5, 2);

    // text
    StdDraw.setPenColor(StdDraw.BLACK);
    StdDraw.text(6, 1, "black text");
  }