Fork: Black Rock City v2

ChatGPT prompt "Write a javascript program using the Turtle API that will draw a map of Black Rock City"
Then "Now improve the code to add more detail."

Log in to post a comment.

const turtle = new Turtle();

// Draws the outer rectangle of Black Rock City
turtle.penup();
turtle.goto(-100, 100);
turtle.pendown();
turtle.forward(200);
turtle.right(90);
turtle.forward(200);
turtle.right(90);
turtle.forward(200);
turtle.right(90);
turtle.forward(200);

// Draws the "Man" statue at the center of Black Rock City
turtle.penup();
turtle.goto(0, 0);
turtle.pendown();
turtle.right(45);
turtle.forward(50);
turtle.right(135);
turtle.forward(35.355);
turtle.right(135);
turtle.forward(50);

// Draws the radial streets around the Man statue
for (let i = 0; i < 8; i++) {
  turtle.penup();
  turtle.goto(0, 0);
  turtle.pendown();
  turtle.right(45 + (45 * i));
  turtle.forward(100);
}

// Draws the inner concentric circles
for (let i = 1; i <= 3; i++) {
  turtle.penup();
  turtle.goto(0, 0);
  turtle.pendown();
  turtle.circle(50 * i);
}

// Draws the campsites
turtle.penup();
turtle.goto(-75, 75);
turtle.pendown();
turtle.forward(50);
turtle.right(90);
turtle.forward(50);
turtle.right(90);
turtle.forward(50);
turtle.right(90);
turtle.forward(50);

turtle.penup();
turtle.goto(75, 75);
turtle.pendown();
turtle.forward(50);
turtle.right(90);
turtle.forward(50);
turtle.right(90);
turtle.forward(50);
turtle.right(90);
turtle.forward(50);

turtle.penup();
turtle.goto(-75, -75);
turtle.pendown();
turtle.forward(50);
turtle.right(90);
turtle.forward(50);
turtle.right(90);
turtle.forward(50);
turtle.right(90);
turtle.forward(50);

turtle.penup();
turtle.goto(75, -75);
turtle.pendown();
turtle.forward(50);
turtle.right(90);
turtle.forward(50);
turtle.right(90);
turtle.forward(50);
turtle.right(90);
turtle.forward(50);

// Draws the art installations
turtle.penup();
turtle.goto(-50, 50);
turtle.pendown();
turtle.circle(10);

turtle.penup();
turtle.goto(50, 50);
turtle.pendown();
turtle.circle(10);

turtle.penup();
turtle.goto(-50, -50);
turtle.pendown();
turtle.circle(10);

turtle.penup();
turtle.goto(50, -50);
turtle.pendown();
turtle.circle(10);