Code.org Learning
code.org learning
Lessons 1-15 Learning
Key Takeaways
- creating a subclass
- PainterPlus myPainterPlus = new PainterPlus();
- subclass is part of a superclass
- writing methods
- public void turnRight() {
- turnLeft();
- turnLeft();
- turnLeft();
- public void turnRight() {
- loops
- public void takeAllPaint() {
- while (isOnBucket()) {
- takePaint();
- while (isOnBucket()) {
- while the first statement is true, repeat the next code
- public void takeAllPaint() {
- if statements
- public void moveSouth() {
- while (isFacingSouth()) {
- if (!canMove(“south”)) {
- move(); }
- else {
- turnRight(); }
- while (isFacingSouth()) {
- only if first statement is true, perform action, otherwise perform second
- public void moveSouth() {