Take your time and read everything thoroughly! There are a lot of parts to this week's lab, and you don't want to miss anything important.
During this lab, you will:
The goal of this lab exercise is to get you acquainted with the Computer Sciences (CS) labs and your CS account. We'd also like to get you using Python on the CS machines or your own machine, and give you some warm-up problem solving exercises. So let's get to it!
First, some lab etiquette. The labs in the CS building are maintained by the Computer Systems Lab (CSL) and we love them and want to keep them happy. Here's what you can do to help:
As a registered (i.e., not auditing or sitting in) CS 301 student, you are provided an account on the CS lab machines. You'll need to activate that account in order to use the computers in the CS building, but it will also grant you (some) storage and webspace on the CS computers, as well as a (limited) printing quota and an email address you can use.
You can either activate your account in the CS labs or through the CSL website by clicking on the "Activate Account" link at the very top of the page and following their instructions.
For many of you, this is your first exposure to programming in an academic setting (or at all!). I'd like to make expectations as far as appropriate academic conduct as clear as possible, so no one ends up accidentally violating the academic misconduct policies of the university.
Take a few minutes to read over the policy in the Appropriate Academic Conduct survey and enter your full name to sign electronically. Note that if you are working in a pair in the lab, both members of the pair will need to sign the policy separately, on their own Learn@UW accounts.
Note: if you skip this step, you'll lose a point on this homework.
This part is to be completed individually by noon on 28 January.
There is one quiz available to you, called "How do functions work?" You'll have four attempts to get as many points as you can (all questions are worth half a point). This is a problem-solving exercise; I don't expect you to know how Python functions work, but I do expect you to be able to reason through it given what you've learned in your math courses up to now.
All questions in the quiz are short answer, and all questions about values should be given as numerals (i.e. "5", not "five").
When you registered for 301, you chose an (optional) weekly lab section. These labs are held in the CS building and on CS-provided Windows computers, but you may choose to complete these exercises outside of the scheduled lab time on your personal computer. You'll only have a TA available to help you out with these assignments in lab or office hours, so choose wisely!
In the CS labs, you'll be using the integrated development environment (IDE) Eclipse, with the Python-specific plug-in PyDev. If you're working on your personal computer, it can be much simpler to just get the spin-off version LiClipse, which comes pre-configured for Python. The link above walks you through getting all of this set up on your personal computer.
Now that your IDE is configured, it's time to actually write some code:
Make sure you're saving your work frequently as you go.
Let's do some more complex problem-solving. "But Hobbes, that sounds like worrrrk!" No, that sounds like playing flash games.
That's right, you're going to play a flash game for homework - specifically Light Bot. Play through as many levels as you can (there are 12, so it's totally possible to beat the game). You'll be including your highest successful Light Bot program as part of this week's assignment!
Light Bot's programs are pictorial, but you'll be submitting yours in writing. Here's the translation:
So a program that consists of:
would be represented in writing as
Take notes as you play - as soon as you successfully complete a level, you're taken to the next one and you won't be able to copy down your last program.
When you're done playing, add your highest-level program to the end of your four_fours.py file in this format (substitute your own highest level and code in the appropriate places):
# Highest level: (level number) # # Main: (main code) # F1: (function 1 code, if any) # F2: (function 2 code, if any)
These "hashtagged" (starting with #) lines are called comments, and are completely ignored by the interpreter when you're running a program. If you added these lines correctly, try running four_fours.py now and note that they had absolutely no effect on the outcome of your program. Comments are great that way!
A note on academic misconduct. The purpose of this portion of the assignment is NOT just to get the answer, it's to get practice problem-solving in a low-pressure, fun situation. Solving these problems on your own is a way to help yourself as the course progresses. If you feel you need to cheat to complete this assignment, maybe this course isn't the right one for you right now.
At the top of your four_fours.py file, add your name (and if you coded with a partner, their name as well) as comments, like this:
# Author: (your name) # Pair Partner: (your partner's name)
You'll be handing in your lab work via the course Learn@UW dropboxes. Navigate to our 301 course page, and click the Dropbox link in the top navigation bar. You should see a dropbox for Program 0 - this is where you should hand in your four_fours.py file. (If you worked in a pair, only one person will need to hand in the code.)
Note that the dropbox will close at noon on 28 January, so be sure to submit your files before then.
During this lab, you should have:
If you missed something, GO BACK AND DO IT AGAIN.