petite/src/wombat/scheme/libraries/TurtleAPI.java
public static Image turtleToImage(String data) {
		List<LineData> lines = new ArrayList<LineData>();
		
		for (String line : data.split("\n")) {
			String[] parts = line.trim().split(" ");
			if (parts.length == 0) continue;
			if (parts.length != 8) throw new IllegalArgumentException("Malformed turtle data with line: " + line);
			lines.add(new LineData(
				Integer.parseInt(parts[0]),
				Double.parseDouble(parts[1]),
				-1.0 * Double.parseDouble(parts[2]),
				Double.parseDouble(parts[3]),
				-1.0 * Double.parseDouble(parts[4]),
				new Color(
					Integer.parseInt(parts[5]),
					Integer.parseInt(parts[6]),
					Integer.parseInt(parts[7])
					)
				));
		}
		
		return linesToImage(lines, 10);
	}
/**
	 * Convert a turtle to an image.
	 * @param data Lines each with "tick x0 y0 x1 y1 r g b" 
	 * @return An image.
	 */
Convert a turtle to an image.
@param data Lines each with "tick x0 y0 x1 y1 r g b"
@return An image.
Convert a turtle to an image . @param data Lines each with " tick x0 y0 x1 y1 r g b " @return An image .
public static Image turtleToImage(String data) {
		List<LineData> lines = new ArrayList<LineData>();
		for (String line : data.split("\n")) {
			String[] parts = line.trim().split(" ");
			if (parts.length == 0) continue;
			if (parts.length != 8) throw new IllegalArgumentException("Malformed turtle data with line: " + line);
			lines.add(new LineData(
				Integer.parseInt(parts[0]),
				Double.parseDouble(parts[1]),
				-1.0 * Double.parseDouble(parts[2]),
				Double.parseDouble(parts[3]),
				-1.0 * Double.parseDouble(parts[4]),
				new Color(
					Integer.parseInt(parts[5]),
					Integer.parseInt(parts[6]),
					Integer.parseInt(parts[7])
					)
				));
		}
		return linesToImage(lines, 10);
	}
public static Image turtleToImage ( String data ) { List < LineData > lines = new ArrayList < LineData > ( ) ; for ( String line : data . split ( "\n" ) ) { String [ ] parts = line . trim ( ) . split ( " " ) ; if ( parts . length == 0 ) continue ; if ( parts . length != 8 ) throw new IllegalArgumentException ( "Malformed turtle data with line: " + line ) ; lines . add ( new LineData ( Integer . parseInt ( parts [ 0 ] ) , Double . parseDouble ( parts [ 1 ] ) , - 1.0 * Double . parseDouble ( parts [ 2 ] ) , Double . parseDouble ( parts [ 3 ] ) , - 1.0 * Double . parseDouble ( parts [ 4 ] ) , new Color ( Integer . parseInt ( parts [ 5 ] ) , Integer . parseInt ( parts [ 6 ] ) , Integer . parseInt ( parts [ 7 ] ) ) ) ) ; } return linesToImage ( lines , 10 ) ; }
Convert a turtle to an image.
Convert a turtle to an image .