Codingassignmenthelper | Home Codingassignmenthelper | University

Finch Can Dance’ Python Program

Assignment :

For this Programming Assignment, you must make your Finch do the Hokey Pokey.
The Hokey Pokey is called the Hokey Cokey in England.1
As fun as this exercise is, it is a really great introduction to object oriented programming in Python. Our next weeks will build on this and will also use the Finch.
For those of you less than fifty years of age, here is the usual version of the Hokey Pokey.

You put your right foot in.
You take your right foot out.
You put your right foot in, and you shake it all about.
You do the Hokey Pokey and you turn yourself around, that’s what it is all about.

But Finch has no feet.
So here is the Finch version of Hokey Pokey, henceforth called ‘the Finchy Pokey’ except in England, where it is the ‘Finchy Cokey’:

You move your bright beak in.
You move your bright beak out.
You move your bright beak in and you shake it all about.
You do the Finchy Pokey and you turn your Finch around, and that’s what it’s all about.

Your completed program should:
Print, ‘Finch is going to do the Finchy Pokey now.’ Make your Finch do the above dance. Make Finch move forward, move back, move forward, wiggle, then turn around (in any way you can program it to do so.)
For full credit, that is what it is all about.

Note: Finch dances best on a smooth carpet dance floor, preferably one with a funky disco ball. Finch does not seem to like dancing on smooth floors or on thick carpet. The dance need not be perfect, close is good enough.

Below are helpful hints. You need not start from scratch! To do this assignment, start with the Dance.py program supplied to you. Copy and paste it to create a new program with a new name, one that you can mess with and eventually submit for grading. Call it the Finchy Pokey. By trial and error you will see that you can change Finch’s motion by changing these two simple commands that are found throughout Dance.py:
snakyFinch.wheels(1,1)
sleep(1)

Rather than read about Finch, I suggest you explore Finch’s abilities by trial and observation.
In the snakeyFinch function, arguments (1,1) control the VELOCITY of the wheels. So snakyFinch.wheels(1,1) means move BOTH wheels forward at max speed. To change these motions, replace these arguments with any number between -1 to 1 (negative one to one -- that said, numbers below absolute value 0.2 or so don’t seem to result in motion). Study the Dance.py program to see how this works.

I would suggest slowing all of Finch’s dancing down so that the arguments for wheel motion are all below 0.5. Finch is a better slow dancer, than fast.
From what I can tell sleep(1) does not mean, ‘stop and rest’. Rather, it means, ‘keep doing what you are doing for 1 unit of time.’ So if it is moving forward, it keeps doing so. So, try playing with that too.
Notice that snakyFinch.led(0,0,255) uses as arguments the 256 brightness levels for each of the three different color (Red, Green, Blue respectively) LEDs. So, you can make Finch’s beak change colors. You don’t have to do that for this assignment but, it might be fun to try and change the beak color with each new ‘move’.
If you need to add additional motions – more steps than are in Dancy.py – just add more blocks like this:
snakyFinch.led(0,0,255)
snakyFinch.wheels(1,1)
sleep(1)

Note that each block of three statements is a dance move plus a beak color change! Add or subtract as many moves as you need to in order to make Finch move forward, move back, move forward, shake, then turn around.

Please submit your script file and also past your code below and return this word document to me.

Metaphysical theorists have long argued about whether or not the Hokey Pokey really is ‘what it is all about.’ Things got very heated in the 1970s between this camp, and those who believe that the answer to everything is ‘42’. The ‘42’ camp eventually prevailed and most scholars who study the matter now believe that the Hokey Pokey is just a goofy dance.


To Download Click Here > Finch Can Dance’ Python Program.pdf
Codingassignmenthelper | Home Codingassignmenthelper | Home