Tuesday, October 22, 2019

Project 3: Breakout

Warm-up 

   This is the game that took the world by storm and jump started the Video Game industry. Breakout works on extremely low graphics and with simple user input devices.

   Link to an online version of Breakout for demonstration:
https://www.mathsisfun.com/games/bap.html

   In 1972, when video games were still very new and relatively unknown, a new game took the world by storm. A simple simulation of tennis using two-dimensional graphics, minimal sounds, and extremely basic controls, Pong became the first arcade game to achieve widespread popularity and is credited as the genesis of the modern video game industry. Today, the game has been played, remade, spun-off, and referenced innumerable times and it remains, to many, the single most identifiable and recognizable game in the history of video games. A brilliant spinoff was Breakout, which ran with one paddle and a ball and could be played with one player. 

   Use custom blocks to implement your own version of Breakout . Who knew back then that this would be the start of a $25B industry ?

Monday, October 21, 2019

3.6 Robot in a Maze

3.6 Robot in a Maze

In this project, you will use blocks that someone has already created for you in order to program a robot to get through several mazes.

Goal: Analyze and Utilize code that someone has created in advance. Continue to abstract from detail. 


Five mazes have been created for you. The code you write to escape each maze should be as simpleconcise, and elegant as possible.

Click below for the lab:
Due: Tuesday 10/22/19

Friday, October 18, 2019

Lesson 3.4 Reporter and Predicate Custom Blocks

Review of Custom Blocks:
  • Reporters report either a number or a text string.
    Reporter (round shape) Examples:  ,
  • A Predicate is a special kind of Reporter that always reports true or false.
    Predicate (hexagonal shape) Examples:  ,



 Lab 3.4 - If My Calculations Are Correct...

  • Write custom reporter and predicate blocks to perform a number of useful calculations and computations.
  • Name your project lastName_firstName_lab3.4Calculations
  Due before class on Monday October 21, 2019 

Thursday, October 17, 2019

3.3 Calendar Update Part 2

Big Idea:

Given the amount of days that have passed in the current year, (assume no leap years for now), give the date. 

For example, 

  • If you input 1, your script should return January 1
  • If you input 17, your script should return February 17
  • If you input 32, your script should return February 1
  • If you input 60, your script should return March 1
  • If you input 364, your script should return December 30
Right Now:

You need to analyze the algorithm that humans use to do this. Have a year calendar open. Look at the dates. How do YOU do this? What feature of code can you use to automate this? You will work on paper for a bit here. Stay organized and be able to explain your method to your whole group. You won't be able to code it until you have designed the program.

10/17/2019 Update:
Finish up yesterday's calendar project. When you are done:

1) Add a question that asks: "What is the Year?"
  • If the year given is a leap year, your calendar project should adjust.
  • Make sure you use your custom blocks from 3.3 
  • For example, say the user gives that 64 days have passed this year. 
    • If it not a  leap year, the date is March 5. If it is a leap year, the date is March 4. 
Bonus! 

The Gregorian Calendar was enacted in 1582 to account for calendrical drift. Essentially, this was a way to account for the fact that the earth's orbit is approximately 365.242 days. Given that January 1, 1583 is defined as a Saturday:
    • Use logic and math to find out what day January 1st fell on for the years 1583 to 1593. You can use google to check your answer, but you should be able to explain WHY the day changes each year. 
    • Now, create a custom block that will give you the day of the week January 1st falls on for any year after 1582.
    • Use the output of the block above to determine what day of the week a day is in any given date. For example, if the date is 10.16.2019, the day is Wednesday.
    • Incorporate this math into your Calendar Update program to give the day of the week as well as the date. 
2) Study for Next Week's upcoming test with the study guides posted earlier. 

Friday, October 11, 2019

3.3 Let Me Check My Calendar

  • Warm-up : Answer these questions :
    • What are the three different types of Custom Blocks?
    • What is the name of the variable that is input into a Custom Block?
    • What is the name of the variable that is output from a Custom Block?
  • Add-on Vocabulary for Custom Block
    • Analogous Data Structures for Custom Block in other CS languages:
      • In Snap : Custom Block
      • C, Python : Function, Method
      • java, C++, OO Programming): Method
  • Reporter and Predicate custom blocks:
    1. Reporters report a value such as a number or a text string. Reporters have a round shape.
    2. A Predicate is a special kind of Reporter that always reports True or False. Predicates have a hexagonal shape: 
  • Argument Definition: Similar to mathematics, an argument is the specific input (the actual text string, number, or Boolean) passed to the function.
  • Read More 
  • Parameter Definition: The variable found inside the Custom Block or function. In Snap, it is referred to as the Input Variable. Parameters are very similar to script variables, except their values come from outside the Custom Block. 
    • Therefore the Parameter name used should be different than the Argument Variable Name (outside the block) to avoid any confusion of which variable is used inside the block.
    Read More

 Lab 3.3 Let Me Check My Calendar Part 1 

  • Write some custom blocks that take arguments and are useful for calculations involving dates and calendars
  • Name your project LastName_FirstName_Lab3.3_Calendar_Part1
  Due Monday   October 14, 2019

Tuesday, October 8, 2019

3.1 Variables

Lesson 3.1   Variables 

  • Variable Definition: a "place" to store a value for retrieval and use later
  • Variables are created, assigned a value, and accessed for use
  • A variable can only hold one value at a time. When a new value is assigned, the old value is lost and cannot be recovered.
  • Variable names should be descriptive and readable.
  • Lab 3.1 Conversion Due: Thursday 10/10/2019

Blog information move to Google Doc

Hello All, Moving forward, please find all information about the class that you used to find on a live google doc agenda. The link is foun...