Assignment1_CollectNewspaperKarel
来源:互联网 发布:童年阴影知乎 编辑:程序博客网 时间:2024/05/01 18:57
/*
* File: CollectNewspaperKarel.java
* --------------------------------
* At present, the CollectNewspaperKarel subclass does nothing.
* Your job in the assignment is to add the necessary code to
* instruct Karel to walk to the door of its house, pick up the
* newspaper (represented by a beeper, of course), and then return
* to its initial position in the upper left corner of the house.
*/
import stanford.karel.*;
/*
* Name:
* Section Leader:
*/
public class CollectNewspaperKarel extends SuperKarel {
public void run() {
// You fill in this part
turnRight();
move();
turnLeft();
while (noBeepersPresent())
move();
pickBeeper();
turnAround();
while (frontIsClear())
move();
turnRight();
move();
turnRight();
}
}
* File: CollectNewspaperKarel.java
* --------------------------------
* At present, the CollectNewspaperKarel subclass does nothing.
* Your job in the assignment is to add the necessary code to
* instruct Karel to walk to the door of its house, pick up the
* newspaper (represented by a beeper, of course), and then return
* to its initial position in the upper left corner of the house.
*/
import stanford.karel.*;
/*
* Name:
* Section Leader:
*/
public class CollectNewspaperKarel extends SuperKarel {
public void run() {
// You fill in this part
turnRight();
move();
turnLeft();
while (noBeepersPresent())
move();
pickBeeper();
turnAround();
while (frontIsClear())
move();
turnRight();
move();
turnRight();
}
}
- Assignment1_CollectNewspaperKarel
- 索爱Xperia Play (Z1i)如何解锁? 如何root? 怎么刷机?
- [一分钟先生]张彤:技术转型做管理,只靠技术提升还远远不够
- C++面向对象程序设计
- ♂天天向上--9.4
- 学习Redis
- Assignment1_CollectNewspaperKarel
- 优先级翻转
- 4个视频中行为识别的底层特征检测、描述及代码
- Canonical Trends 论文理解
- graphiti笔记2
- poj 2001 Shortest Prefixes(字典树)
- Assignment1_StoneMasonKarel
- Hadoop 错误码 查询
- 各种流行的编程风格