import java.awt.*; public class Rug_BuggleWorld extends BuggleWorld { int n = 18; public void setup () { setDimensions(n,n); //set up n x n grid } public void run () { // create a RugBuggle object weaver RugBuggle weaver = new RugBuggle(); // tell weaver to weave a red outer concentric ring weaver.outer_ring(Color.red); // shift position of weaver to middle concentric ring weaver.move_in(); // tell weaver to weave a blue middle concentric ring weaver.middle_ring(Color.blue); // shift position of weaver to inner concentric ring weaver.move_in(); // tell weaver to weave an inner yellow concentric ring weaver.inner_ring(Color.yellow); } } // define a RugBuggle class which extends the Buggle class with rug weaving methods class RugBuggle extends Buggle { // this method weaves the outer concentric ring of a rug public void outer_ring(Color c) { outer_edge(c); turn_corner(); outer_edge(c); turn_corner(); outer_edge(c); turn_corner(); outer_edge(c); turn_corner(); } // this method weaves the middle concentric ring of a rug public void middle_ring(Color c) { //put your code here } // this method weaves the inner concentric ring of a rug public void inner_ring(Color c) { //put your code here } // this method weaves an edge of the outer concentric ring of a rug public void outer_edge(Color c) { pattern1(c); pattern2(c); pattern2(c); pattern2(c); pattern2(c); } // this method weaves an edge of the middle concentric ring of a rug public void middle_edge(Color c) { //put your code here } //this method weaves an edge of the innermost concentric ring of a rug public void inner_edge(Color c) { //put your code here } // this method weaves rug pattern 1 in a 3x3 grid public void pattern1(Color c) { //put your code here } // this method weaves rug pattern 2 in a 3x3 grid public void pattern2(Color c) { //put your code here } //this method weaves rug pattern 3 in a 3x3 grid public void pattern3(Color c) { //put your code here } // this method weaves rug pattern 4 in a 3x3 grid public void pattern4(Color c) { // put your code here } // this method turns and moves the buggle to the starting position and starting heading for //the next edge of a concentric ring of a rug public void turn_corner() { //put your code here } // this method moves the buggle to the starting position and starting heading of the next concentric // ring of a rug public void move_in() { //put your code here } }