Pass the Parcel specification game[preparetopass12,pass12,preparetopass23,pass23, preparetopass34,pass34,preparetopass41,pass41, musicstop,musicstart,present]

Slides:



Advertisements
Similar presentations
Chapter 7 Sorting Part II. 7.3 QUICK SORT Example left right pivot i j 5 > pivot and should go to the other side. 2 < pivot and should go to.
Advertisements

Inheritance - Case Study TCP1201: 2013/2014. Case Study – Guessing Game Listed below is the code to play a guessing game using procedural programming.
CS12230 Introduction to Programming Tying things together.
2012: J Paul GibsonTSP: MSC SAI Mathematical FoundationsMAT7003.Computability- Answers.1 MAT 7003 : Mathematical Foundations (for Software Engineering)
Making Decisions in Python Sec 9-10 Web Design. Objectives The student will: Understand how to make a decision in Python Understand the structure of an.
EGR 141 Computer Problem Solving in Engineering and Computer Science
Place captured red pieces below Place captured blue pieces below Rules New Game Exit Left mouse click on piece – drag to desired location - left mouse.
Top-Down Design CSC 161: The Art of Programming Prof. Henry Kautz 9/16/2009.
School of Computing and Mathematics, University of Huddersfield CIA2326: WEEK ?? LECTURE: Introduction to Algebras SUPPORTING NOTES: See chapters 8,9,10.
Section 4.2: Functions that Test Conditions (continued)
Alfredo Perez Resident Mathematician Texas A&M University GK-12 Program.
School of Computing and Mathematics, University of Huddersfield CIA2326 Week 14 LECTURE: How to reason with Algebraic Specifications TUTORIAL/PRACTICAL:
I.1 ii.2 iii.3 iv.4 1+1=. i.1 ii.2 iii.3 iv.4 1+1=
Software Testing Prof. Dr. Holger Schlingloff Humboldt-Universität zu Berlin and Fraunhofer Institute of Computer Architecture and Software Technology.
I.1 ii.2 iii.3 iv.4 1+1=. i.1 ii.2 iii.3 iv.4 1+1=
© 2007 Ray S. Babcock Tracks Game is played on a (nxn) set of squares. There are three possible moves (labeled A,B,C). Players alternate making a move.
Selection Sort
Find all the factors pairs of 20.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #005 (April somthin, 2015)
INTRODUCTION TO VC++ As the Microsoft Windows 3.X and then 5.5 operating system was becoming popular, many programmers were interested in creating graphical.
University of Regina Full LOTOS Department of Computer Science University of Regina, Regina SK, Canada Yashu Bither Amrudee Sukpan Tetyana Manuylenko Chakka.
ECS 10 10/8. Outline Announcements Homework 2 questions Boolean expressions If/else statements State variables and avoiding sys.exit(…) Example: Coin.
Describe Them! Pass the Ball Game Speak loudly and clearly!
How To Play Mancala BY PETER Mancala is a game where you use marables to play. It takes to players.
Wham! The Edge of Grammar Heaven Making grammar more interesting!
Programming Fundamentals. Today’s lecture Decisions If else …… Switch Conditional Operators Logical Operators.
Math Proving Lines parallel. Last time we said that if two lines are parallel and they are cut by a transversal then... Certain angles are congruent.
Game theory Impartial Games.  Two-person games with perfect information  No chance moves  A win-or-lose outcome  Impartial games ◦ Set of moves available.
Implementation of the Hangman Game in C++
School of Computing and Engineering, University of Huddersfield CIA2326 Week 14 LECTURE: Formal Specifications. How to reason with Algebraic Specifications.
Training Activities All with a ball drills Follow the Leader Tag / Kick out games Steal a ball 1 v 1 Dribble to another area Dribble through the goals.
Where Do Frogs Come From Comprehension Game Directions: 1. Read your story. 2. Cut out playing cards. 3. Sort the playing cards into two piles or columns:
Selection Sort
How to Play Pass the Parcel Sean & David: This game is played in the United Kingdom.
More – means the number is bigger like an elephant. Less – means the number is smaller like a mouse.
BADMINTON Quiz No.1 1. What happens when a serve touches the net and passes over the net and falls within the proper service court. a. Good, play on it.
Picking Apples. Subtraction game. Turn over two cards from 0-10 Work out the difference. If you have an apple with this amount put a counter on it. First.
CS12230 Introduction to Programming Extra example– More on responsibilities 1.
3:00. 2:59 2:58 2:57 2:56 2:55 2:54 2:53 2:52.
StarLogoTNG 101 Treasure Hunt Game Unit Wrap Up. Today’s Agenda Review Mini-lesson and programming practice on set camera and ID Finish making the treasure.
1 Pass the Parcel /* Pass the parcel in Promela */ /* passing is not atomic */ /* communication is asynchronous */ /* Muffy Calder, November 2000 */ mtype.
Boat Racing Game Challenge #4 By Chris Brown Under the direction of Professor Susan Rodger Duke University, January 2013 Based off of the Boat Racing Game.
Prepared by 1/1.   This group goes to the library to : 1- Get information about sports. 2- Know the importance of spots. Handball Group.
Challenge #1: Table Boxing o Each table has a wrapped gift box o The Goal: Easy! Open the box.
Prepare Prioritize! Bring plenty of resumes No casual attire InappropriateAppropriate.
Adding Sounds Games Programming in Scratch. Games Programming in Scratch L6 Adding Sounds Learning Objectives Learn how to add sound to a Scratch game.
Section 3.4 Solving Equations with Variables on Both Sides Objectives: Collect variables on one side of an equation.
1. Read the following presentation and watch the videos for your grade level. 2. Write your name on your index card and answer the “Bob” questions at the.
Special Triangles Review
Mrs. Tracy Moricone Game Design Project 3
Objective: Learning multiplication, problem solving skills through activities. Creating the multiplication stories.
Bool operators and, or, not
Recitation 13 Searching and Sorting.
Chapter 3 Graphing.
Top Fire Protection Services Ottawa available on Dubinskyconstruction
ФОНД ЗА РАЗВОЈ РЕПУБЛИКЕ СРБИЈЕ
Starter 15//2 = 7 (Quotient or Floor) (Modulus) 22%3 =1
Inequalities.
Notes 9.5 – Mathematical Induction
Слайд-дәріс Қарағанды мемлекеттік техникалық университеті
.. -"""--..J '. / /I/I =---=-- -, _ --, _ = :;:.
'III \-\- I ', I ,, - -
I1I1 a 1·1,.,.,,I.,,I · I 1··n I J,-·
Repetitious operations
LONG MULTIPLICATION is just multiplying two numbers.
use your multiplication chart for help:)
,, 'III \-\-
. '. '. I;.,, - - "!' - -·-·,Ii '.....,,......, -,
Pass the Ball Game Pass the ball. When the music stops – whoever has the ball must answer the question Find the conversation question sheets (on many topics!)
Presentation transcript:

Pass the Parcel specification game[preparetopass12,pass12,preparetopass23,pass23, preparetopass34,pass34,preparetopass41,pass41, musicstop,musicstart,present] :exit (* Pass the Parcel Game *) (* M. Calder 1999 *) (* represent passing by two events:preparetopass and pass *) (* if music stops during passing, i.e. after prepare but before pass *) (* the intended recipient unwraps the parcel *) library boolean endlib (***********************) (* The Parcel ADT *) (***********************) type Parcel is boolean sorts Parcel opns wrappers : Parcel -> bool new : -> Parcel add : Parcel -> Parcel unwrap : Parcel ->Parcel initial : Parcel eqns forall p:Parcel ofsort bool wrappers(new) = false; wrappers(add(p)) = true; ofsort Parcel Uuwrap(add(p)) = p; unwrap(new) = new; initial = wrap(wrap(wrap(new))); endtype (***********************) (* Basic Player Process*) (***********************) process Player[preparetoreceive,receive,preparetopass,pass, musicstop,musicstart,present](parcel?:bool) :exit := [parcel?] -> HasParcel[preparetoreceive,receive,preparetopass,pass, musicstop,musicstart,present](initial) [] [not (parcel?)] -> (present; exit [] HasnoParcel[preparetoreceive,receive,preparetopass,pass, musicstop,musicstart,present]) endproc

(*********************) (* Player Has Parcel *) (*********************) process HasParcel[prepr,receive,prepp,pass,stop,start,win](p:Parcel) :exit := (* p is the parcel *) (* music is playing, player is about to pass the parcel *) (* pass the parcel: 3 possibilities *) (* i) pass the parcel interrupted by music stop *) (* ii) pass the parcel, no interruptions *) (* iii) music stops before parcel passing commences *) (prepp; (stop; pass!p; ((win; exit) [] (start; HasnoParcel[prepr,receive,prepp,pass,stop,start,win])) [] (pass!p; HasnoParcel[prepr,receive,prepp,pass,stop,start,win]))) [] (* music stops before beginning to pass *) (* unwrap the parcel and win if no wrappers left *) (let newp:Parcel = unwrap(p) in (stop; i; ([not(wrappers(newp))] -> (win; exit) [] (start; HasParcel[prepr,receive,prepp,pass,stop,start,win](newp))))) endproc

(*******************************) (* Player Does Not Have Parcel *) (*******************************) process HasnoParcel[prepr,receive,prepp,pass,stop,start,win]:exit := (* music is playing, player is about receive the parcel *) (* receive the parcel: 3 possibilities *) (* i) parcel passing interrupted by music stop, *) (* unwrap the parcel after receipt and exit if no wrappers left*) (* ii) receive the parcel, no interruptions *) (* iii) music stops before parcel passing commences*) (prepr; ((stop; receive?p:Parcel; i; (let newp:Parcel = unwrap(p) in ([not(wrappers(newp))] -> (win; exit) [] (start; HasParcel[prepr,receive,prepp,pass,stop,start,win](newp))))) [] (receive?p:Parcel; HasParcel[prepr,receive,prepp,pass,stop,start,win](p)))) [] (* music stops before parcel received *) (* don't actually receive anything *) (stop; ((win; exit) [] (start; HasnoParcel[prepr,receive,prepp,pass,stop,start,win]))) endproc (*****************************) (* Music *) (*****************************) process Music[start,stop] :exit := stop; (exit [] start; Music[start,stop]) endproc

(*******************************) (* A Game with 4 Players *) (*******************************) process FourPlayer[preparetopass12,pass12,preparetopass23,pass23, preparetopass34,pass34,preparetopass41,pass41, musicstop,musicstart,present] : exit := (((Player[preparetopass41,pass41,preparetopass12,pass12, musicstop,musicstart,present](true) |[preparetopass12,pass12,musicstop,musicstart,present]| Player[preparetopass12,pass12,preparetopass23,pass23, musicstop,musicstart,present](false)) |[preparetopass23,pass23,musicstop,musicstart,present]| Player[preparetopass23,pass23,preparetopass34,pass34, musicstop,musicstart,present](false)) |[preparetopass34,pass34,perparetopass41,pass41,musicstop,musicstart,present]| Player[preparetopass34,pass34,preparetopass41,pass41, musicstop,musicstart,present](false) ) |[musicstart,musicstop]| (musicstart; Music[musicstart,musicstop]) endproc endspec