Week 0 Assignment

Sat through the remainder of the week 0 yesterday and it was fun to see what can be done with Scratch. If you don't know what that is, it is a visual programming language that was designed for use in teaching children to program.

Forever young innit.

These are the requirements for this assignment.

  • Your project must have at least two sprites, at least one of which must resemble something other than a cat.
  • Your project must have at least three scripts total (i.e., not necessarily three per sprite).
  • Your project must use at least one condition.
  • Your project must use at least one loop.
  • Your project must use at least one variable.
  • Your project must use at least one sound.
  • Your project should be more complex than most of those demonstrated in lecture (many of which, though instructive, were quite short) but it can be less complex than Ivy’s Hardest Game. As such, your project should probably use a few dozen puzzle pieces overall.

I'm going to use this blog post to sort out my project for this assignment. I'm thinking of a project where Donald Trump and an aide of his are soliciting donations from members of the public. This will be the flow:

  1. Ask the user for their name (aide)
    1. If the user provides their name within x seconds, move to the next step (2)
    2. If the user does not provide their name within x seconds, say something mean (Trump)
  2. Present the user the choice to donate or not (aide)
    1. If the user donates, move to the next step (3)
    2. If the user does not donate, say something mean (Trump)
  3. Thank the user for their donation (Trump)
  4. Restart the program after x seconds
How does this do compared with the requirements for this assignment?

  • Your project must have at least two sprites, at least one of which must resemble something other than a cat. Yes, I will have Trump and an aide.
  • Your project must have at least three scripts total (i.e., not necessarily three per sprite). Sounds complicated enough to use at least three scripts
  • Your project must use at least one condition. There are two if-else clauses, so this is satisfied
  • Your project must use at least one loop. We will restart the program after it is done, so there will be a loop
  • Your project must use at least one variable. We will store the user's name in a variable
  • Your project must use at least one sound. We can have Trump say something at the end. Like "bye".
  • Your project should be more complex than most of those demonstrated in lecture (many of which, though instructive, were quite short) but it can be less complex than Ivy’s Hardest Game. As such, your project should probably use a few dozen puzzle pieces overall. The project above will definitely meet this bar.
Process:
  1. The first step is to get the two sprites. It took some time to figure out how to import sprites, but I figured out how to upload sprites from my computer after clicking around the GUI (graphical user interface). Saved pictures of Donald Trump and Sarah Sanders to my downloads folder and we're good to go!
  2. The next action required is to ask the user for their name. Started with an event (when green flag is clicked). Said "hello", waited one second, and asked the user for their name. This is stored in the "answer variable"
  3. I've run into a challenge with the "if user does not provide their name" bit. I can't figure out how to check if answer is blank. So what I am doing is to check if answer - answer = 0 (but this is also true for a blank answer (i.e. 0-0=0 so I need to find another approach). I've done this by checking if the length of answer is > 1. If the length of answer is not > 1, the aide asks the user to move along.
  4. Feels like I need to create a "say something mean" function for Trump.
  5. Okay I'm going to stop with the blow-by-blow commentary now as it's slowing me down. I'm instead going to just try to finish it and come back at the end.
  6. On Wednesday, October 13, I stopped at step 2.

Comments

Popular posts from this blog

Starting (again)