Lesson 03

(Please ignore this - these are notes for myself for the next iteration of this course)

  1. Reflecting On Your Progress
    For this exericse you'll need to stop and think about how things have been going in this class and then post to this week's discussion forum with your thoughts.

    1. Exercise: Reflecting On Your Progress  (Required)
      NOTE:
      You will be required to post two (2) comments on this week's discussion forum.  One of these needs to be a response to someone else's post so please do NOT leave this to the last minute!

      This was finished as of 12:30am on 1/29/2015.  Everything that you need to do this exercise is now available in the above link.

  2.  

  3. Exploring Conditional Statements With The SpaceSmasher Game:
    Setting Up SpaceSmasher
    During this lesson we will continue to work with the SpaceSmasher game.  Instructions for setting up your computer to run SpaceSmasher were covered in the prior lesson.

  4. Exploring Repetition ("Looping") Statements With The SpaceSmasher Game:
    Tutorial Topics
    All of the following exercises are from the 'Loops Lab' document. 
    I will keep refering to the 'Loops Lab' document but will not link to it to avoid people asking if all the links actually go to the same document or not.  They all refer to the above link.
    NOTE: You do NOT have to do viewing quizzes or an outline for any of videos in this section (item 7.A.I and 7.B.I through 7.B.VII)

    1. Exercise: Warmup With Looping Statements
      Within the 'Loops Lab' document, find the section with the title "Loops Warmup" (this is on or near page 3).  Write out the C# code that best expresses the English written on each line (which are numbered 1 through 6). 
      Please put your answer into the MS Word file named "Loops Warmup.docx" (which is already in the starter project .ZIP file)

      1. VIDEO: Loops Warmup Exercises

    2. Exercise: Work Through The 'Lab Exercises' Document
      Within the 'Loops Lab' document, work through the following exercises.  
      NOTE: There are a lot of exercises marked as "Hand In" here, but the document walks you through pretty much all of them almost step-by-step.

      1. Exercise: TODO 1:  Single For Loops In SpaceSmasher  & Building The blockSet   (Hand-In)
        Remember, the detailed description of this exercise (and all the other exercises in this section) are located in the 'Loops Lab' document
        1. VIDEO: Building multiple rows of blocks using a loop

      2. Exercise: TODO 2: Single While Loops & Winning the SpaceSmasher Game    (Hand-In)
        1. VIDEO: Win by removing the entire top row, not just the top-left block

      3. Exercise: TODO 3: Refactoring Loops & Building the blockSet Again   (Hand-In)
        (There is no video for this exercise)
      4. Exercise: TODO 4: Nested For Loops in Revealing Block Powers    (Hand-In)
        1. VIDEO: Reveal the special power (if any) of all the blocks

      5. Exercise: TODO 5: Nested While & For Loops For a Better Win Condition     (Hand-In)
        (There is no video for this exercise)
      6. Exercise: TODO 6:  Nested For Loops & Removing Neighboring Blocks    (Hand-In)
        1. VIDEO: Removing a cluster of neighboring blocks

      7. Exercise: TODO 7:  For Loops Inside While Loops, Loop Conversions & Revealing Block Powers   (Hand-In)
        (There is no video for this exercise)

Add for next time:

  • TryParse: cover that 'loop until you get valid input' schema

Materials from prior quarters

  1. Files: Random numbers, manually bounded   (Demo File)

  2. VIDEO: Random Numbers: Seed Values

  3. VIDEO: Random Numbers: the .Net-specific .Next(min, maxPlusOne) method

  4. VIDEO: Random Numbers: Seed Values & non-random numbers

  5. VIDEO: Random Numbers: Using the plain .Next() & modulus ( % )

  6. Exercise: Basic Random Number Generation (Sect. 7.9 (Shift/scale: 7.9.1)) (Hand-In)
  7. Exercise: Sentinel-controlled loops: Averaging numbers (Sect. 5.7) 
  8. Exercise: Printing A Range Of Numbers (Previous Knowledge) (Hand-In
  9. VIDEO: Nested Loops Demo Video   VS Project Used in the Video (There is no viewing quiz for this)
  10. Exercise: Nested Loops: Rectangles  (Sect. 5.8)
  11. Exercise: Nested Loops: Hollow Rectangles (Sect. 5.8) (Hand-In)
Feedback / Improvements on exericses:
(Please ignore this - these are notes for myself for the next iteration of this course)
  1. Simple loops - while, for (Sect. 5.5)
    TODO: Change this - do...while should do something, then ask the user if they wish to repeat  

Redo voting:

  1. Q + A: String Comparison with ==, String.Compare
    x1 My computer was running really slow?

  2. Basic Array of Primitive Types
    x4 Redundant questions; shorter or split it up

  3. How To Adjust The Console's Buffer Size

  4. Arrays as Parameters (syntax)
    x2 Slower & more detailed - back & forth was hard to follow

  5. Arrays as Parameters (pass by reference vs. pass by value)

  6. Arrays as return types
    x1 Hard-to-hear student Q+A

 

 

14) XNA Based Exercises: (Video Games)

If you do not want to do the console based exercises then you can choose to do the following, video-game-based exercises instead:

  1. Exercise: Read through the Match3 Orientation (Required)
    1. This will show you some of the basic aspects of the API for the game (API = functions you can call to make things happen in the game).  It does not cover repetition (loops) at all.
    2. You are NOT required to watch any of the game videos, although you may find it useful to do so. 
    3. Note that the code samples in the game tutorials use Java instead of C#.  You'll notice that there's a table labeled 'Warning: Language Differences' which will tell you to replace Java's KeyEvent.VK_SPACE with C#'s Keys.Space, for example.  While the C# project correctly uses C#, you will need to fix any code that you copy-and-paste from the tutorial into your program.
    4. While you will use the knowledge you gain from this tutorial in future exercises, there is nothing that you are required to hand in for this tutorial.
      1. In particular, read through the final section which explains the keyboard shortcuts to pause/restart the chain, spawn various balls, etc.  This level of control can help you figure out problems when you're writing code.
  2. Exercise: Read through the Collisions, Cursors, and Transactions Overview (Required)
    1. This will explain some of the basic concepts that this game uses.
    2. While you will use the knowledge you gain from this tutorial in future exercises, there is nothing that you are required to hand in for this tutorial.
  3. Exercise: Read through the Collision Detection tutorial (Required)
    1. This will explain some of the basic aspects that this game uses
    2. While you will use the knowledge you gain from this tutorial in future exercises, there is nothing that you are required to hand in for this tutorial.
  4. Exercise: Read through While loop tutorial (Hand-In
    1. This will show you how to recolor all the balls behind the point of collision
    2. You need to complete exercise #1
      1. Do all the work for this exercise by modifying the C# starter project for this tutorial that is linked to on the tutorial page (near the top
      2. In order to hand this in you will need to find the ClassTutorial.cs file and then copy it into a folder named While_Loops inside .ZIP folder that you will submit for grading.
        1. Please note that the file name has changed from Game.cs (in the BlockBreaker / Conditional tutorials) to ClassTutorial.cs (here in the Match3 / Repetition tutorials)
  5. Exercise: If you're curious about how to implement the 'Match3' functionality that this week's game is actually based on then read through the While Loop Matching tutorial. (Optional)
    1. This is entirely optional.  The instructor will never ask you quiz or exam questions about the material that is covered exclusively in this tutorial. 
      (In other words - you still need to know material that's covered in other tutorials but used in this one, but you do NOT need to know the stuff that is specific to this tutorial)
  6. Exercise: Read through For loop tutorial  (Hand-In
    1. This will show you how to recolor all the balls behind the point of collision (recolor the next three balls)
    2. You need to complete exercise #1
      1. Do all the work for this exercise by modifying the C# starter project for this tutorial that is linked to on the tutorial page (near the top
      2. In order to hand this in you will need to find the ClassTutorial.cs  file and then copy it into a folder named For_Loops inside .ZIP folder that you will submit for grading.
  7. Exercise: Read through Nested loops tutorial (Hand-In)
    1. This will show you how to handle multiple shot-balls flying through the air at the same time.
    2. You need to complete exercise #1
      1. Do all the work for this exercise by modifying the C# starter project for this tutorial that is linked to on the tutorial page (near the top
      2. In order to hand this in you will need to find the ClassTutorial.cs  file and then copy it into a folder named Nested_Loops inside .ZIP folder that you will submit for grading.