StoneMasonKarel - buildColumn(); nextColumn(); }...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * File: * -------------------------- * The StoneMasonKarel subclass as it appears here does nothing. * When you finish writing it, it should solve the "repair the quad" * problem from Assignment 1. In addition to editing the program, * you should be sure to edit this comment so that it no longer * indicates that the program does nothing. */ import stanford.karel.*; public class StoneMasonKarel extends SuperKarel { public void run() { while(frontIsClear()){
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: buildColumn(); nextColumn(); } buildColumn(); } private void climbUp() { if(noBeepersPresent()){ putBeeper(); } while(frontIsClear()){ move(); if(noBeepersPresent()){ putBeeper(); } } } private void climbDown() { while(frontIsClear()){ move(); } } private void nextColumn() { if(frontIsClear()){ for(int i=0;i<4;i++){ move(); } } } private void buildColumn() { turnLeft(); climbUp(); turnAround(); climbDown(); turnLeft(); } }...
View Full Document

This note was uploaded on 10/25/2010 for the course CS 106A at Stanford.

Page1 / 2

StoneMasonKarel - buildColumn(); nextColumn(); }...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online