Assigned Date: Monday, Jan. 30, 2023
Due Date: Friday, Feb. 3
Due Time: 30 mins before class
Contents
Assignment
Write a complete Python program using JythonMusic to generate this artifact from the 1960s – “Schotter”, by Georg Nees (see here and here).
NOTE: For this assignment, focus only on random displacement of each square. Do not worry about rotating it. This will simplify the assignment, and focus on what we are learning. So, no rotation – only displacement.
VERY IMPORTANT:
Avoid at all costs to look at anyone else’s code. There are many possible solutions to this. Try to develop your own solution, without getting any ideas or even hints (e.g., peek at an existing solution on the web, because you are stuck) – again, avoid this, at all costs. It is better to get stuck and not complete the assignment, than to read someone else’s code and get ideas on how to move forward. Doing so will deprive you of the opportunity to develop your own creativity and ability, or prowess for coming up with your own solutions.
Imagine you are in the shoes of Georg Nees, trying to do this for the first time. That’s what we are trying to recreate – i.e., synthesize a solution from what you know, and try to discover what you need to learn, in order to achieve your goal. This is the purpose of this assignment, so that when you are at work in a few years, you can do the same (and be able to keep your job, and advance in your career). The sooner you learn how to do this, the better.
Program Documentation
The Golden Rule of Style: “A program should be as easy for a human being to read and understand as it is for a computer to execute.” [1]
Your code should have general comments at the top, which explain what the program does. Look at the book examples here.
NOTE: Your comments should describe the WHY, and NOT the HOW – the how we can read in the code. Why is something being done? What is its purpose? What is it achieving? That’s what your comments should answer. The bigger picture. It is actually much better and easier to write the comments first, and THEN figure out how to do this in Python. In fact, doing so WILL save you time – “if you cannot say it in English, you cannot code it”. Much faster to figure out how to describe it in English first. Try it. You will never go back.
You should comment all variables, obscure statements, and blocks of code.
Give your program a meaningful name, e.g., schotter.py.
Header Documentation
VERY IMPORTANT: Copy and paste the following to the top of your program.
Update it, to fit what your program does.
# nameOfYourProgram-MakeSureYouUpdateThis.py # # Author: Your full name # Email: Your school email # Class: The class you are in # Assignment: Homework #2 # Due Date: The due date # # Purpose: Describe what the program does. # # Include any special notes, such as URLs of background information or sources (very important). #
Grading
Your grade will be based on how well you followed the above instructions, and the depth/quality of your work.
Submissions
1. Bring to class the following:
- A printout of your Python program.
- Be ready to demonstrate your program in class.
2. Also, submit your Python (.py) file on OAKS, so I can run it on my computer.
Reference
- Cooper, D. and Clancy, M. (1985) “Oh! Pascal”, 2nd ed., W.W. Norton & Company, New York, p. 42.