第一课主要是介绍课程内容,所用资料以及评分系统,末尾介绍了一下Karel机器人。它是一个斯坦福的学生开发来帮助计算机编程的课堂教学的。
课上需要用到Eclipse开发环境。主要涉及Java。教材包括几十页的Karel介绍小册子以及The Art and Science of Java. ASJ的作者在网上发布了自己的初稿,虽然肯定比不上正式版本,但是作为自学也够用了。
Karel的介绍以前读过,这次就大略复习了一下。
第二课讲的是Karel的基本操作。
Karel basic commends: move(), turnLeft(), pickBeeper(), putBeeper()
Use tabs to be visually appearing
Karel class:
public class OurKarelprogram extends Karel {}
Karel is case sensitive
new commend:
private void turnRight () {
turnLeft ();
turnLeft ();
turnLeft ();
}
SuperKarel: turnRight
FOR loop
While
If...else...
Test beepersPresent(), frontIsClear(), ...
Write programs people can read and understand!
Gerneralize the program