 Make sure you are subscribed to announcements on Moodle.  Activity 4 will be due 48hrs after your lab ends.

Slides:



Advertisements
Similar presentations
Writing Pseudocode And Making a Flow Chart A Number Guessing Game
Advertisements

Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Recursion Alice.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Harry Potter Scratch Game
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
A Christmas Scratch game
Python Magic Select a Lesson: Why Learn to Code? Basic Python Syntax
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
Logo Lesson 5 TBE Fall 2004 Farah Fisher. Prerequisites  Given a shape, use basic Logo commands and/or a procedure to draw the shape, with and.
CIS101 Introduction to Computing Week 12 Spring 2004.
Wizard Game: Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July
Programming – Touch Sensors Intro to Robotics. The Limit Switch When designing robotic arms there is always the chance the arm will move too far up or.
1.
LISTS. RECAP Major Topics Variables Functions Sensing Messaging OOP.
Noadswood Science,  To know the basics of Python coding and decoding Monday, September 07, 2015.
Making a Timer in Alice.
Computer Bugs Original Powerpoint By: Spring LIS4480 Coding Team Jon.
SPELLING GAME PROJECT SAMPLE ASSESSMENT MATERIAL GCSE Computing.
Outlines Chapter 3 –Chapter 3 – Loops & Revision –Loops while do … while – revision 1.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Visual Basic Games: Prepare for Hangman
Spiral Rider PAGE 1. Set Up Scene 1.Add Stage-underwater scene 2.Add crab sprite 3.Add two fish sprites PAGE 2.
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
Using MIT Scratch for Programming and Control Exercise 6 – Creating a Scratch Packman Year 9 ICT Autumn Term 2007.
Teaching a character to walk in more than one world: Parameters and Inheritance. By Lana Dyck under the direction of Professor Susan Rodger Duke University.
Summer Computing Workshop. Introduction  Boolean Expressions – In programming, a Boolean expression is an expression that is either true or false. In.
Implementation of the Hangman Game in C++
A Simple Quiz: Ask User Functions. By Lana Dyck under the direction of Professor Susan Rodger Duke University June 2009, added Part 2 July 2011.
Structured Programming: Debugging and Practice by the end of this class you should be able to: debug a program using echo printing debug a program using.
GAME102 - INTRO WHILE LOOPS G. MacKay. Fundamental Control Structures  STRAIGHT LINE  CONDITIONAL  LOOPS.
Making a Timer in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
 There are times when you will want blocks to repeat. Instead of duplicating blocks and ending up with a long script that might be confusing, there.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
How to use the PRS Clickers with PowerPoint Created by: Lindsay Proctor.
CONTROL FLOW The order in which blocks are executed is called the “control flow” of the script So far all our scripts have just executed blocks in the.
CRE Programming Club - Class 2 Robert Eckstein and Robert Heard.
Agenda Perform Quiz #1 (20 minutes) Loops –Introduction / Purpose –while loops Structure / Examples involving a while loop –do/while loops Structure /
This tutorial will talk you through a very basic workbench queueing simulation. The queueing system modelled is of customers entering an infinite capacity.
Marble Racer. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Lesson 1. Security At the menu bar at the top you will see the word Tools. Click your mouse on Tools scroll down to Macro. Move the Mouse over and down.
More Sequences. Review: String Sequences  Strings are sequences of characters so we can: Use an index to refer to an individual character: Use slices.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Controls and Constants. Review In an experiment, there is something that a scientist is testing – they control this…
Hangman Code Brittany Moses.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
HANGMAN- Software/ Hardware Integration Project Idea was to design a working C++ program to play a Hangman word guessing game Idea was to design a working.
Loops. Review Control Structure – making decisions if-statement Program Design Understand what you want to do Design your solution Write and test your.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Vex Robotics program three: using motors and sensors together.
Introduction to Scratch We will be using the Scratch Environment today, so please log in to the Scratch website (scratch.mit.edu)
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Objective of the lesson Use Blockly to make a dice for Snakes and Ladders All of you will: – Make an image which displays when you press a button Most.
Scratch Programming Cards
Repetition Structures
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
Python - Iteration Iteration
Let's Race! Typing on the Home Row
Programming – Touch Sensors
Scratch: selection / branching/ if / If…else / compound conditionals / error trapping by Mr. Clausen.
Introduction to TouchDevelop
Variables & getting info from the user
Iteration – While Loops
under the direction of Professor Susan Rodger
Presentation transcript:

 Make sure you are subscribed to announcements on Moodle.  Activity 4 will be due 48hrs after your lab ends

 Variables › Script variable  Lists  Loops  Custom Blocks › We can create 3 types of blocks; command, reporter and predicate.

 Hangman Rules: › There is a secret word to be guessed › The player guesses letters in the word until either all letters are guessed and the word is known, or the player runs out of guesses. › The program should give the player feedback on every guess › The program should give the player feedback when they win or lose, say the number of guesses and the secret word.

 Step 1: Choose a word  Step 2: Word  List.  Step 3: Report number of letters in Word  Step 4: Begin Guessing!  Step 5: Report number of guesses  Step 6: Display letters  Step 7: Report win or loss, play again?

 The Setter first enters the secret word by entering a response to an “ask” block. › The first thing we’ll need to do is have the game ask one player for a word. › We can do this using sensing blocks. › We can define answer by setting it to a variable

 Notice we created a block for “ask for word”  What does the shape tell us about the block › Command, reporter, or predicate?

 The word is immediately hidden from view after the Setter finishes entering it. › After we have the word, we’ll need to store it letter by letter. › Create a script that will go through the word and store the letters, one by one, in a list. › Consider the blocks below.

 Create variable letter_list  Again, notice the shape of this block.

 The program starts by telling the Guesser how many letters are in the secret word. › We should tell the other player how long of a word they are guessing › Use the “say” block, “join” block, “length of list” block and the variables we just created.

 “Length of list” block is a reporter block

 Guesser guesses a letter; the program tells the player whether their guess was right or wrong › Now, we want the second player to guess letters until they run out of guesses or they guess the entire word. › What kind of control blocks should we use;  To do something over and over?  To stop when something happens?

 List that shows correct letters as the game is being played. (similar to hangman blanks)  List that shows the guesses made by player

 Repeat until one of two things happen › Lives left equals zero or › Guess word, correctguess_list is equals to letter_list › If we want to repeat until this is TRUE…we will create _______ statements (reporter, predicate, command?)

 What belongs inside this repeat? › Simplify by creating code inside into a block

 Similar to “break word into list” › Use script variables › “Ask” player to make a guess

 When the guesser guesses a letter, we want to show them where it appears in to actual word, if it does. › Already created a list of blanks the same size as the actual word (correctguess_list) › Replace the blanks with the right letters as they are guessed.  What are the current list we have?

 What if the guess is wrong?

 If guess is wrong… › Report incorrect guess › Take away a life › Reports # of lives

 The program displays the letters guessed correctly so far, in their proper location in the word. › Need to make sure the correctguess_list has the correct amount of blanks.  Use “add _ to list” › Allow the list to be seen on the stage.

 We want blanks to appear, and equal the same length of the word

 When the guesser either runs out of guesses or has successfully guessed the word the game ends. › Report a win or loss. › Ask if the player would like to play again  If yes, the game now ask the Guesser to become the Setter.  Repeat game.  If player wants to play again, what variables must be reset?

 Now, Customize your game!!