SPELLING GAME PROJECT SAMPLE ASSESSMENT MATERIAL GCSE Computing.

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

CMPT 100 : INTRODUCTION TO COMPUTING TUTORIAL #5 : JAVASCRIPT 2 GUESSING GAME By Wendy Sharpe 1.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
30/04/ Selection Nested If structures & Complex Multiple Conditions.
ABNIAC The following slide presentation is to acquaint the student with ABNIAC. The version used for presentation is the Java version, which can be found.
Harry Potter Scratch Game
3-2 What are relational operators and logical values? How to use the input and disp functions. Learn to use if, if-else and else-if conditional statements.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
1 An intro to programming concepts with Scratch Session 3 of 10 sessions Repetition and variations.
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.
Program Design and Development
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
1 Lab Session-III CSIT-120 Spring 2001 Revising Previous session Data input and output While loop Exercise Limits and Bounds GOTO SLIDE 13 Lab session.
CIS101 Introduction to Computing Week 12 Spring 2004.
Adding Automated Functionality to Office Applications.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
1.
Chapter 8: String Manipulation
Programming with Microsoft Visual Basic th Edition
Creating Embedded Formative Assessment Dr. Steve Broskoske Misericordia University EDU 533 Computer-based Education.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
A453 Exemplar Password Program using VBA
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
 Make sure you are subscribed to announcements on Moodle.  Activity 4 will be due 48hrs after your lab ends.
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
Quiz Me Tutorial. Introduction QuizMe is a trivia game (the example uses baseball) you can use as a template to build quizzes on any topic. The user steps.
Implementation of the Hangman Game in C++
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 17 – Flag Quiz Application Introducing One-Dimensional.
30/10/ Iteration Loops Do While (condition is true) … Loop.
Scratch Programming Lesson 4 Question asking and answering.
CSC 211 Data Structures Lecture 13
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.
Control Structures II Repetition (Loops). Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1.
04/11/ Arrays 1D Arrays Defining, Declaring & Processing.
PROGRAMMING In Lesson 2. STARTER ACTIVITY Complete the starter activity in your python folder – lesson 2 Now we will see how you got on and update your.
1 ball, 2 ball, red ball, blue ball By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Advanced Work with Embedded and Summative Assessment Dr. Steve Broskoske Misericordia University EDU 533 Computer-based Education.
Georgia Institute of Technology More on Creating Classes part 2 Barb Ericson Georgia Institute of Technology Oct 2005.
Algorithms Writing instructions in the order they should execute.
Dr. Soha S. Zaghloul2 Let arr be an array of 20 integers. Write a complete program that first fills the array with up to 20 input values. Then, the program.
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.
Conditional Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Chapter 3 Control Structures. The If…Then Statement The If…Then statement is a Decision statement = that executes a set of statements when a condition.
Programming Fundamentals I Java Programming Spring 2009 Instructor: Xuan Tung Hoang TA: Tran Minh Trung Lab 03.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Iteration. Iteration: Review  If you wanted to display all the numbers from 1 to 1000, you wouldn’t want to do this, would you? Start display 1 display.
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.
31/01/ Selection If selection construct.
05/02/ Records. 205/02/2016 Learning Objectives State: The difference between records and arrays. The difference between records and arrays. How.
Controlling Program Flow with Decision Structures.
Controlling Program Flow with Decision Structures.
Hangman Code Brittany Moses.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Phase 3: Game Creation. Phase 3: Game Creation Outcomes (Slide 1) I can create a flowchart to solve a problem, for example to make a cup of tea. I can.
Slide 1 Chapter 4 The If…Then Statement  Conditional control structure, also called a decision structure  Executes a set of statements when a condition.
26/06/ Iteration Loops For … To … Next. 226/06/2016 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Scratch Programming Cards
Engineering Innovation Center
Introduction to TouchDevelop
random number between 1 and 5.
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Game Over Module 4 Lesson 2.
Presentation transcript:

SPELLING GAME PROJECT SAMPLE ASSESSMENT MATERIAL GCSE Computing

Objectives 1.The program should store the words in the list 2.The user should be able to add a new word, if the word is chosen to be added to the array is already in the array then the program should tell the user that the word is already in the array otherwise it will add the word the to the array 3.The word should not be able to be chosen twice until the game is restarted and the word chosen by the program should be overwritten with a 0 4.The program should pick a word at random and display it for a short period time 5.The user should be invited to make a guess in response to the word generated by the computer 6.If the user enters the same combination of characters to make up a word guess then this should be rejected by the program 7.The chosenword and the users guess should be written to the chosenword and myguess list 8.The chosenword and the users guess lists need to be of equal length. 9.The program should tell the user how many letters guessed match the chosen word and how many letters were guessed correctly and how many are incorrect. 10.If the word entered by the user matches the word chosen by the computer then the program should indicate this is a correct guess 11.If the user guesses incorrectly 3 times he should lose the game

Algorithm – Add a word and start the game Sub AddAWord Set counter to one Set flag to false Input the newword Set newword to Answer while counter is less than or equal to the length of the words list or flag = false if newword = item counter of words list set the flag to true else set the flag to false Counter = counter + 1 if flag = true then add this word to the list of words Sub Start Set lives to 3 Reset chosenword and myguess lists = “ ” Set answa “ “ Repeat until answa = “y” or “n” Answer = Input “do you want to rest the list” If answer = yes activate reset Elseif answer = no Activate playme Sub reset Set Counter to 1 Set wordpicked to 1 Reset wordsasked = “” Repeat lengthofwordslist Add item(counter)of words to wordlist Counter = counter + 1 Activate playme This sub starts the game initialising the lives to 3 at the start and offering the user the chance to reset the list. The words are copied into the wordsasked list and picked from these/ This sub checks adds a newword to the list, before that it checks the word added is not in the list already.

Algorithm – Play the game Sub Playme Set wordchosen to “” Set gameover to false Set lenwordsasked to lengthofwordsasked Set pickme to 0 If wordspicked is less than the lengthofwords Repeat until length of item pickme of wordsasked is less than 1 Randomize Set pickme to 1 to the length of wordsaskedlist Display itempickme of wordsasked list for 0.5 seconds Set wordchosen = item pickme of wordsasked Set item pickme of wordsasked to 0 Wordspicked = wordspicked + 1 Call makeaguess Else Display all words are used up Sub makeaguess Set tempword to “” Input – what is your guess Set tempword to answer Reset correct letters “” Call checkifusedbefore Sub checkifusedbefore Set flag = false Set counter = 1 Repeat until counter = length of Incorrectwordsguessed + 1 or flag = false If tempword = item(counter) Incorrectwordsguessed then flag = true Else flag = false If flag = true then Display guessed word has been used before Else if flag = false Call make a guess Insert tempword at the last Incorrectwordsguessed Call checkword Sub checkword Set tempword = myguess If myguess = wordchosen Display you have won Call you have won Else Call write2array

Sub write2array Reset chosenword,myguess and correctletters lists = “ ” Set Counter to 1 Repeat until counter = length of wordchosen + 1 Add letter counter of wordchosen to chosenword Counter = Counter + 1 Set Counter to 1 Repeat until counter = length of myguess + 1 Add letter counter of myguess to myguess list Counter = Counter + 1 Call checklistsize Else Display all words are used up Sub checklistsize Set lenmyguess to len(myguess) Set lenwordpicked to len(wordschosen) If lenmyguess = lenwordpicked Display list sizes are equal If lenmyguess > lenwordpicked Set counter = lenwordpicked Repeat until conter – lenmyguess Add * to chosenwordlist Counter = counter + 1 Elseif lenmyguess < lenwordpicked Set counter = lenmyguess Repeat until conter = lenwordpicked Add * to chosenwordlist Counter = counter + 1 Call howmanyletters Sub howmanyletters Set lettersright = 0 Set letterswrong = 0 Set counter = 1 Repeat len(chosenword) If item(counter) chosenword = item(counter)myguess Lettersright = Lettersright + 1 Insert item(counter)of myguess(list) at last of correctletters list Else Letterswrong = letterswrong + 1 Insert “ “ at last of correctletters Counter = counter + 1 Sub analyseresult If lettersright < lenwordpicked Lives = lives – 1 If lives = 0 Display “you have lost” Gameover = true Call you have lost If lettersright = len(chosenwordlist) Call youhavewon Algorithm – Check lists and play game

Importing the words Set up a list from Import the words into the list from a text file. Do not manually enter them yourself this is a waste of time.

Design – variables and list design Tempword – string used to store the value of the users guess whilst the program checks that the combination of characters in the word entered as a guess has not been entered before Answer – set to y or n in response to questions posed by the prog, for example do you want to reset the list Counter – used as a means to increment through a counter for example adding the chosenword into the chosenword list Flag – used as a Boolean value set to true or false if for example the combination of characters entered by a user as a word has been used before Gameover – Boolean value set to true / false used to indicate the end of the game Lenmyguess – variable stored as an integer to indicate the length of the variable my guess Lenwordpicked - variable stored as an integer to indicate the length of the variable wordpicked Lettersright – integer stores the values of no of letters that the user has guessed correctly Letterswrong – integer stores the values of no of letters that the user has guessed incorrect Lives – integer keeps track of the number of lives that the user has this is set a t 3 from the beginining Newword – string value – used to store the value of the new word being entered into the array Pickme – integer set as a random value between 1 and the length of the words list Wordchosen – string – stores the value of the word chosen by the program Wordpicked – stores the value of the number of words that the program has picked Words – stores the value of the words in the list Wordsasked copies the value of the words in the wordsasked Chosenword – individual characters from the wordchosen variable will be stored here Myguess individual characters from the myguess variable will be stored here Incorrectwordsguessed – incorrect word guess combinations will be stored here

Design User Interface Input Box Lives Chosenw ordlist. Mygue ss. Words. Wordsasked. Incorrect wordlist In the design of my interface for the game I am going 6 lists. One which will store the words, the words asked, the individual characters of the words chosen by the program and my guess, The incorrect words the user has chosen, and the correctword list will display the characters correctly guessed by the user. Correctw ordlist The variables listed will also be displayed at various points as the program is executed Play MeAdd A Word

Testing and Development – User Interface 1.The program should store the words in the list This shows that the words are stored in a list. The words are imported into the list and then copied into the wordasked list. At the start of the game the user is offered the chance to reset the game and copy the words from the words list into the wo

Testing and Development 2) The user should be able to add a new word, if the word is chosen to be added to the array is already in the array then the program should tell the user that the word is already in the array otherwise it will add the word the to the array When the add a word sprite is clicked the variables are set at the start with counter at 1, newword as “ “ and flag to false. The user enters a new word in the newword variable and this value is checked against each value in the words list to see if it is in the words list. If it is a message is displayed saying the word is already in the array, if not the word is added at the end. Test – word to be entered Floccinaucinihilipilification (longest word in the English language Word entered Word added Same word entered againAnd blown out Test successful as the same word cannot be entered again

Testing and Development 3) The word should not be able to be chosen twice until the game is restarted and the word chosen by the program should be overwritten with a 0 All of the variables are initalised at the start, gameover – false, letterscorrect and letterswrong are 0. If the wordpicked value is less than the lengthofwords then the script will repeat until the length of item pickme of wordsasked is greater than 1. The value will then be displayed and set to wordchosen variable and this space will be overwritten with a 0. The wordspicked variable will be changed by 1. If all the words have been used in the list then the message will be display all words have been used up. Test – word chosen GIF The word GIF is chosen by the program as this is item number 229, this is overwritten with 0 in the wordsasked list.

Testing and Development 4) The program should pick a word at random and display it for a short period time The word is selected by the program displayed for approximately 1 second

Testing and Development 5) The user should be invited to make a guess in response to the word generated by the computer 6) If the user enters the same combination of characters to make up a word guess then this should be rejected by the program Tempword is initialised at the start of the sub and the user is invited to make a guess in response to the word generated by the program. The users guess is written into this variable. Flag is set to false and counter to 1 and the program checks if the combination of letters / characters entered have been used before. If it has the user is invited to make another guess otherwise this is added to the list wordsguessed list Word selected is ASDL– the user is invited to make a guess. Guessed entered ADSADS is going to be entered again And the entry is rejected

Setting up the Data Structure Each of these variables will be used later on in the game, Import the data into the list

Testing and Development 7) The chosenword and the users guess should be written to the chosenword and myguess list The variable Myguess – is set to tempword, if these value are the saem then the game terminates and the you have won sub is called. If these 2 variables are not the same then the chosenlist, myguess and correctletters lists are reset. The wordchosen and myguess variables are then written into the chosenlist and myguess lists. The size of the lists are then compared This shows the users guess and the chosenword chosen by the program are written to the lists. The program equalises the lists by adding a *.

Testing and Development This sub is run to equalise the length of the lists, will add a * to the chosenword list or the myguess list depending on which one is the smaller. Entered ADSLR Both lists are equalised and the correct letters are included in the correct letters list, expect it leaves a blank at the end. Both the chosenwordlist and myguess list are equal 8) The chosenword and the users guess lists need to be of equal length.

Copying Data to another list We are going to copy of the contents of wordslist to wordsasked Create the following script Set counter to 1 Add item counter of wordlist to wordasked the other list we have created. This is going to used throughout this game This shows the words being copied into the wordsasked list

Testing and Development 9) The program should tell the user how many letters guessed match the chosen word This set sets initialises the letters right and letters wrong variables. The loop runs thorough the loop and checks if item counter of chosenword is equal to item counter of the myguess, if this lettersright is incremented by and the correct letter is inserted into the correct letters list. If not the letterswrong is incremented by 1 and a space is inserted in the correctletters list. This tells the user what letters are correct and which ones are incorrect. CPU chosen C is entered as a guess, the arrays are initialised and the letters right = 1 and letterswrong = 2

Testing and Development 10) If the word entered by the user matches the word chosen by the computer then the program should indicate this is a correct guess This sub analyses the results if the no of lettersright is less than the len(wordpicked) variable then a life is deducted. If lives = 0 then the game will terminate and if the noofletters right = lengthofthechosenword list then the game is won. This shows the game being won after 1 incorrect guess. The correct word was CPU

Testing and Development If the user guesses incorrectly 3 times he should lose the game 1) Word picked File System enter guess file 2) Try 2 guess entered past guesses to list and lists equalised 2 nd guess entered and unsuccessful 3 rd attempt entered 3 rd unsuccessful attempt and game ends

Pick A word Enter the following script. We are going to create a sub here called start the game Variable – change howmanywordssaked by 1 Use the repeat until function Repeat until the lengthof item rnd(ofwordsasked) > 1 then Set chosenword to = item (rnd) of wordsaksed This sub checks the length of the word chosen and makes sure that word cannot be chosen again.

Make A Guess Enter the following script so that the user can make a guess. If the guess is correct the game should terminate Create 2 lists where the user’s guess and the computers chosen word are written.

Write to the lists and check length of list These subs will write the user guess and the chosen word to the chosenwordlist and userwordlist. This sub checks the length of each list. If they are not equal it will write an * to the list.

Game result The following sub checks the result and records the number of letters correct and the number of letters wrong

Extension 1)See if you can set a number of lives 2)Reveal only the correct letters in the places where they appear and * with the incorrect guesses 3)Create a sub which will add a new word and checks to see if it is in the list 4)What can you do to extend this into a hangman game? 5)Can you use the custom blocks in BYOB to improve your programming technique