As an exercise in solving algorithmic problems, program Karel to place a single beeper at the center of 1st Street. For example, if Karel starts in the world cs106 – assignment #1 – task #4 – start
it should end with Karel standing on a beeper in the following position: cs106 – assignment #1 – task #4 – end Continue reading “cs106a – Assignment #1 – Task #4”
In this exercise, your job is to get Karel to create a checkerboard pattern of beepers inside an empty rectangular world, as illustrated in the following before-and-after diagram: cs106 – assignment #1 – task #3 – 8×8
This problem has a nice decomposition structure along with some interesting algorithmic issues. As you think about how you will solve the problem, you should make sure that your solution works with checkerboards that are different in size from the standard 8×8 checkerboard shown in the example. Odd-sized checkerboards are tricky, and you should make sure that your program generates the following pattern in a 5×3 world: cs106 – assignment #1 – task #3 – 5×3
Another special case you need to consider is that of a world which is only one column wide or one row high. The starter folder contains several sample worlds that test these special cases, and you should make sure that your program works for each of them.
Karel has been hired to repair the damage done to the Quad in the 1989 earthquake. In particular, Karel is to repair a set of arches where some of the stones (represented by beepers, of course) are missing from the columns supporting the arches, as follows: cs106 – assignment #1 – task #2 – start Continue reading “cs106a – Assignment #1 – Task #2”
Your first task is to solve a simple story-problem in Karel’s world. Suppose that Karel has settled into its house, which is the square area in the center of the following diagram:
Prerequisites to the third lecture is reading the chapters 4 to 6 of “Karel the Robot learns Java”. They provide an introduction to top-down design and algorithms.
Prerequisites to the fouth lecture is reading the chapters 1 and 2 of “Art and Science of Java”. The lecture provides a brief history of computer science and describes how the lessons learned from Karel can be translated to Java.
Prerequisites to the fifth lecture is reading chapter 3 of “Art and Science of Java”. The lecture provides an introduction into variables an data types.
Prerequisites to the sixth lecture is reading chapter 4 of “Art and Science of Java”. The lecture further introduction into using variables, their scope and how to combine them, as well as constants and last but not least combining boolean structures.
Code for these lecture as well as the used worlds are available on github.