Code.org takeaways
import org.code.neighborhood.Painter;
public class MyNeighborhood {
public static void main(String[] args) {
PainterPlus myPainterPlus = new PainterPlus();
// Lesson 6 Level 3
// TO DO #1: Instantiate a PainterPlus object.
// Lesson 7 Level 2
// TO DO #1: Navigate the PainterPlus object
// to the traffic cone.
myPainterPlus.move();
myPainterPlus.move();
myPainterPlus.move();
myPainterPlus.turnRight();
myPainterPlus.move();
myPainterPlus.move();
}
}
import org.code.neighborhood.*;
public class PainterPlus extends Painter {
public PainterPlus() {
super();
}
public void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
}
// Example from code.org
public class MyNeighborhood
// Example from code.org
PainterPlus myPainterPlus = new PainterPlus();
// where PainterPlus is the class and myPainterPlus is the object
// Example from code.org
myPainterPlus.turnRight();
// syntax
public class PainterPlus extends Painter {
public PainterPlus() {
super();
}
}
// example from code.org
public class PainterPlus extends Painter {
public PainterPlus() {
super();
}
public void turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
}