Code 2.1


import java.awt.*;
import java.awt.image.MemoryImageSource;
import java.awt.image.PixelGrabber;
import java.io.PrintStream;
import java.util.Vector;

public class TurtleGraphics extends Canvas
{
class Label
{

int xPos;
int yPos;
Font font;
String text;

Label(int i, int j, Font font1, String s)
{
xPos = i;
yPos = j;
font = font1;
text = s;
}
}

class Pen
{

Color color;
int size;

Pen(int i, Color color1)
{
size = i;
color = color1;
}
}

class Line
{

double heading;
double length;
int penSize;
Point p1;
Point p2;

Line(Point point, Point point1, double d, double d1)
{
p1 = point;
p2 = point1;
heading = d;
length = d1;
penSize = currentPenSize;
}
}

class Point
{

int x;
int y;

Point()
{
x = 0;
y = 0;
}

Point(int i, int j)
{
x = i;
y = j;
}
}
請您先登陸,再發跟帖!