Algorithmic Thinking & Programming
Middle School Computer Science
Computer Science Standards:
MS.AT: Algorithmic Thinking 1) Use clearly named variables of various data types to create generalized algorithms. 2) Create algorithms which include methods of controlling the flow of computation using “if…then… else” type conditional statements to perform different operations depending on the values of inputs. 3) Identify algorithms that make use of sequencing, selection, or iteration. 4) Describe how algorithmic processes and automation increase efficiency.
MS.PC: Programming Concepts 1) Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs. 2) Create procedures with parameters that hide the complexity of a task and can be reused to solve similar tasks. 3) Seek and incorporate feedback from team members and users to refine a solution that meets user needs. 4) Provide proper attribution when incorporating existing code, media, and libraries into original programs. 5) Use the iterative design process to systematically test and refine programs to improve performance and eliminate errors. 6) Document programs using comments and/or README files to make them easier to follow, test, and debug. 7) Design a function using a programming language.
Algorithmic Thinking: Building Blocks of Programming
What are Variables?
• Variables are like containers that hold information in a program
• They have clear names to describe what they contain
• Different types of variables:
- Numbers (integers, decimals)
- Text (strings)
- True/False values (booleans)
• Examples: - score = 0
- playerName = "Alex"
- isGameOver = false
Conditional Statements: Making Decisions
• "If…then…else" statements help programs make choices
• They control the flow of the program based on conditions
• Structure:
If (condition is true)
Then do this
Else
Do something else
• Example:
If (score > 10)
Then print "You win!"
Else
Print "Try again"
Types of Algorithm Structures
Sequencing: Steps followed in order
Example: Recipe instructionsSelection: Choosing between options
Example: Choosing a path in a mazeIteration: Repeating steps
Example: Counting from 1 to 10
Efficiency Through Algorithms
• Algorithms make processes faster and more accurate
• They help solve complex problems step-by-step
• Automation uses algorithms to:
- Reduce human error
- Save time
- Handle large amounts of data quickly
• Real-world example: Sorting books in a library by title
Student Directions for Module:
Student Directions:
1. Now you will get a chance to create your own game. Watch the getting started video BEFORE you start on your game.
2. Make sure you give your game a title (you can always change it later).
3. Watch the other tutorial videos and complete the steps. You may want to have two screens open at the same time so you can follow along in the video as you create your game. To make two screens hit the windows and right arrow keys at the same time. You will have to use your mouse to move the two screens around to get them where you want them. Answer each set of comprehension questions after each video on paper.
4. After you finish your game, you can check out a retro arcade to download your game. Play it and share it with a classmate. Ask your classmate for some feedback on your game. Improve your game if needed.
Getting Started Tutorial: Microsoft MakeCode Arcade
Getting Started with Microsoft MakeCode Arcade Summary:
In this introductory video on Microsoft MakeCode Arcade, viewers learn how to start a new project by visiting arcade.makecode.com and clicking the "New Project" button, where they can name their project. The video provides a guided tour of the user interface, highlighting the simulator, joypad, and various buttons for controlling gameplay. It explains how to add and edit sprites using the image editor or by selecting from a gallery, and emphasizes the importance of the simulator for testing code. Viewers are also introduced to workspace features, including the toolbox for coding blocks, options for coding in JavaScript or Python, and asset management. Lastly, it covers saving projects as PNG files or uploading them to GitHub, and reassures users that they can enjoy their creations directly from the simulator without needing additional hardware.
Arcade Microsoft MakeCode Link
Microsoft MakeCode Tutorial Video Part 1
Creating a Platformer Game with MakeCode Arcade
1. What is the name of the platformer game being created in the video?
a. Cat Adventure
b. Curious Cat
c. Cat Quest
d. Feline Fun
2. What is the purpose of the MakeCode Arcade tool?
a. To play games
b. To program arcade games
c. To create music
d. To design graphics
3. Which programming language is mentioned as an option for coding in the video?
a. Python
b. C++
c. Ruby
d. Java
4. What color is chosen for the background of the game?
a. Green
b. Sky Blue
c. Red
d. Yellow
5. In which direction does gravity pull the character in the game?
a. Upward
b. Downward
c. Left
d. Right
6. What is the name given to the character in the game?
a. Fluffy
b. Hops and Pause
c. Jumping Jack
d. Catnip
7. What happens when the character falls off the edge of the level?
a. The game ends
b. The character respawns
c. The character flies
d. Nothing happens
8. How does the character jump in the game?
a. By clicking the mouse
b. By pressing the A button
c. By tilting the device
d. By shouting "Jump!"
9. What must the character reach to win the game?
a. The starting point
b. The portal
c. The treasure chest
d. The highest platform
10. What kind of effect occurs when the player loses the game?
a. Confetti falls
b. The screen turns blue
c. A melting effect happens
d. The game restarts
Microsoft MakeCode Tutorial Part 2
Comprehension Questions for "How to Make a Platformer Game"
1. What item is added to the game for the character to collect?
a. Stars
b. Coins
c. Gems
d. Keys
2. What color is the placeholder tile used for coins?
a. Blue
b. Green
c. Yellow
d. Red
3. What happens when the player overlaps with a coin?
a. The game ends
b. The coin disappears
c. The player loses points
d. The player gains points
4. What type of loop is used to spawn tiles for coins?
a. While loop
b. For loop
c. If loop
d. Do-while loop
5. What kind of animation is added to the coins?
a. Spinning
b. Bouncing
c. Floating
d. Flashing
6. What happens when the player overlaps with a flower?
a. Nothing occurs
b. The player gains a life
c. A bee is spawned
d. The game resets
7. What is the player’s starting number of lives?
a. 3
b. 5
c. 10
d. 1
8. What does the bee do when it overlaps with the player?
a. The player gains points
b. The player loses a life
c. The player wins the game
d. The bee disappears
9. How does the player defeat the bee?
a. Jumping on top of it
b. Running away from it
c. Hitting it with a power-up
d. Using a special ability
10. What is used to check the positions of the player and the bee?
a. If/then statement
b. For loop
c. While loop
d. Switch statement
Microsoft MakeCode Tutorial Part 3
Comprehension Questions for "How to Make a Platformer Game in MakeCode Arcade"
1. What is the first thing the creator does to improve the game?
a. Adds new levels
b. Changes the character
c. Sets a background image
d. Deletes the old code
2. Why does the creator want to use a variable in the game?
a. To track the score
b. To know which level the player is on
c. To add more characters
d. To change the background
3. What color is the placeholder tile for the cat's starting position?
a. Blue
b. Pink
c. Green
d. Yellow
4. What happens when the player reaches the portal?
a. The game ends
b. The level increases by one
c. The character changes
d. A new enemy appears
5. Why does the creator need to remove all enemies and items between levels?
a. To keep the game challenging
b. To prevent leftover items from previous levels
c. To save memory
d. To make the game faster
6. What is added to the second level to increase difficulty?
a. More coins
b. Lava pits
c. Walls and bees
d. A new character
7. What condition allows the cat to cling to the wall?
a. If it is jumping
b. If it is hitting the wall and falling
c. If it has collected enough coins
d. If it starts at the bottom
8. What visual change is made when the cat hits a wall?
a. The cat disappears
b. The cat changes to a different sprite
c. The cat's speed increases
d. The cat becomes a different character
9. How does the creator fix the jittering issue when the cat is against the wall?
a. By changing the sprite image
b. By adjusting the Y velocity settings
c. By adding more walls
d. By removing the wall jump feature
10. What does the creator do to test the new level?
a. Plays the game without making changes
b. Adjusts the tile map dimensions
c. Adds more enemies
d. Deletes the previous level