ICS 10 • David G. Kay • UC Irvine

Fourth Homework

As usual, you'll do parts of this assignment with a partner, preferably someone you haven't worked with on a prevoius assignment. Please do what it takes to get partnered up early in the week: Having a partner is part of each assignment; not having one will lower your score. Be sure to use the Partner App so your partnership is recorded.

Part (a)

Read Chapters 1 and 3 of Blown to Bits, which talk about the consequences of representing information digitally. We'll be touching on this material over the next week or two, so there's no huge rush.

Part (b)

Start with this code that plays a simple game of "tag": [Snap version] [BYOB version] (right- or control-click on the link to download it). Click the green flag to start. If you move your mouse over the sprites, they say "Ouch," draw a square, and jump somewhere else (that's it).

With your partner, improve the code in these ways:

When you're done, export your Snap project into a file whose name is in the usual form (e.g., hw4b-joeq-jane25). Submit this document via Checkmate. Just one partner should submit one copy; the file name and your Email message will let us give both partners credit.

Part (c)

This part is optional, in that you're not required to turn anything in. But if you didn't get a perfect score on last week's (Deus X) assignment, we'd recommend that you get a little more practice since similar problems will turn up on the midterm and final. First of all, go back and make sure you know how to get the correct answers on the assignment itself (not just what the correct answers are—we sent those out—but how to get them). If you tried to "eyeball" the problems rather than painstakingly step through each instruction, or worse yet, if you just relied on your partner to figure it out, you're missing the point: The first key concept to understand is the rudimentary, step-by-step nature of machine language program behavior. So step your way through each of the two programs on the assignment, using the input data we provided. If you don't remember what an instruction does, post a question on Piazza and we'll help you out. It's also a good idea to re-read the instructions and advice we provided on the assignment page. We've also put a copy of the Deus X Instruction Set on line, in case you lost yours.

If you're still not seeing the big picture, don't worry. Try the programs again, but this time with different input. Try Part I with these input lines

  7
  9
  1
  2
  0
  1
  (blank line) 
and again with these
    7
    9
    1
    2
 3758
    1
    (blank line)
Try Part II with these input lines
  4
  Mycroft
and again with these:
  1
  Watson

For most people, working through these problems is not quite as much fun as a trip to Disneyland. But the concepts will show up again and again in this course, so it's worth learning them because they'll help you understand other concepts (that you may enjoy more).


David G. Kay, kay@uci.edu
Tuesday, April 25, 2017 10:30 AM