CS 101: Introduction to Computer Science
James Madison University, Fall 2019 Semester

Lab08: Finch robot dance party

Background

And now, the moment you've all been waiting for...ROBOTS! In today's lab, you will write code to make a Finch robot do a "square" dance.

Objectives

Part 1: Hello, Finch!

Your first task is to test out the programs that you and your lab partner brought with you today.

  1. To avoid overwriting each other's files, please rename your programs to username.py (replace with your e-ID).

  2. Open your programs in IDLE and take turns running and debugging them. The goal is to be as creative as possible!

  3. At a minimum, your Finch robot should move forward and backward, turn and swivel, and change colors.

Part 2: Square Dancing

Now that you have created your own dance moves, can you do the same dance as everyone else?

  1. Create a new file named square.py. Write your name and your partner's name at the top.

  2. With your lab partner, write Python code that performs the following dance pattern:

    Move in a square pattern, full speed ahead, for 1 second each side.
    Move in a square pattern, full speed reverse, for 0.5 seconds each side.
    Repeat forever...
    
  3. When you are ready, bring your robot to the dance floor! Make modifications as needed.

Ideally, you should have three loops (an outer loop and two inner loops). Avoid the temptation to copy and paste the same code four times. For bragging rights, see if you can get the Finch to change colors on each side of the square.

Part 3: CodingBat Logic

Download:   logic1.py

CodingBat is a free site of live problems to build skill in Java and/or Python. It was created by Nick Parlante, who is Computer Science lecturer at Stanford. The name "CodingBat" was based on the Greek word "bat" meaning "this domain was available" (or so they say).

  1. Open the logic1.py file and complete the required problems in your web browser. Then copy/paste your code from codingbat.com into your logic1.py file where appropriate.

  2. Before you submit the lab, make sure you can run the entire logic1.py file in IDLE. If you get an error, you may have pasted your code incorrectly. Make sure the indenting is consistent.

Submission Instructions