Karel

A Digital Clock

10 points

In this program you write a Karel program that functions as a digital clock. You write a method for each digit, 0 to 9 -- a method that draws a 0, another method that draws a 1, and so on. In main() you create 5 robots, one to draw each digit (including the colon).

Make the digits 5 rows high and 3 columns wide.  It is important that, in creating each number, you begin at the same place.  For example, in putting down beepers you could always start in the lower-left hand corner of the number.  If you do this, the numbers will be inter-changeable: any number could be drawn in any of the 4 positions.  If you don't do this, you'll have to go back later and fix things. 

Feel free to use abbreviated method names like 'tl()', 'tr()' and 'put()' in writing this program, as you did while writing "Draw a Face #2".

Choose a time and in main() make the necessary method calls to display that time.

I have not yet been able to create a working .jar file for a Karel program. If I learn how to do this, I'll supply a .jar file for this program. Until that happens, here is an image that shows the time 12:58 being displayed by my digital clock program:

Clock

 

Starting Point

You can download DrawDate.java to use as a starting point in writing your program.