settinga.html & setcookiesa.php

Similar documents
Programming Exam. 10% of course grade

Unit 5: What s in a List

Part II: Number Guessing Game Part 2. Lab Guessing Game version 2.0

Concept Connect. ECE1778: Final Report. Apper: Hyunmin Cheong. Programmers: GuanLong Li Sina Rasouli. Due Date: April 12 th 2013

Assignment II: Set. Objective. Materials

Rock, Paper, Scissors

Instructor-added questions in Teaching Survey System. Instructions for selecting and customizing your survey

For this assignment, your job is to create a program that plays (a simplified version of) blackjack. Name your program blackjack.py.

HW4: The Game of Pig Due date: Thursday, Oct. 29 th at 9pm. Late turn-in deadline is Tuesday, Nov. 3 rd at 9pm.

To use one-dimensional arrays and implement a collection class.

CS 371M. Homework 2: Risk. All submissions should be done via git. Refer to the git setup, and submission documents for the correct procedure.

La Gran Aventura. La Gran Aventura. Reels - 5 Wins are counted from left to right. Main Screen

Instructions [CT+PT Treatment]

Self Learning Game Software Requirements Specification Joint Document Version 1

2 The Universe Teachpack: Client/Server Interactions

HW4: The Game of Pig Due date: Tuesday, Mar 15 th at 9pm. Late turn-in deadline is Thursday, Mar 17th at 9pm.

Sudoku Tutor 1.0 User Manual

Activity 6: Playing Elevens

What are the chances?

CSCI370 Final Report CSM Gianquitto

Math 106 Lecture 3 Probability - Basic Terms Combinatorics and Probability - 1 Odds, Payoffs Rolling a die (virtually)

facewho? Requirements Analysis

OZOBLOCKLY BASIC TRAINING LESSON 1 SHAPE TRACER 1

SEEM3460/ESTR3504 (2017) Project

G52CPP Lab Exercise: Hangman Requirements (v1.0)

Memory. Introduction. Scratch. In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

Internet of Things with Arduino and the CC3000

DocuSign for Sugar 7 v1.0. Overview. Quick Start Guide. Published December 5, 2013

CS 787: Advanced Algorithms Homework 1

Introductory Module Object Oriented Programming. Assignment Dr M. Spann

or More Events Activities D2.1 Open and Shut Case D2.2 Fruit Machines D2.3 Birthdays Notes for Solutions (1 page)

JS Lab 5 Due Thurs, Nov 30 (After Thanksgiving)

The VBA will have such a set of files available on the VBA Bridge Resource CD for some major systems. Guess where you can get a copy

Best Practices For Consultants

In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

The 2013 British Informatics Olympiad

GRAPHOGAME User Guide:

Application for Symbolic Analysis of Linear Circuits Including Switched Circuits

Visual Quality Assessment using the IVQUEST software

Distributed Systems 2nd Homework

Kismet Interface Overview

1. Exercises in simple sketches. All use the default 100 x 100 canvas.

Tac Due: Sep. 26, 2012

Lucky Leprechaun. 1. Overview. Game Rules (v1.2-28/06/2016) The goal is to obtain a winning combination on a winning line spread across the reels.

1 Document history Version Date Comments

Distributed Intelligence in Autonomous Robotics. Assignment #1 Out: Thursday, January 16, 2003 Due: Tuesday, January 28, 2003

Begin this assignment by first creating a new Java Project called Assignment 5.There is only one part to this assignment.

RosterPro by Demosphere International, Inc.

YEDITEPE UNIVERSITY CSE331 OPERATING SYSTEMS DESIGN FALL2012 ASSIGNMENT III

STATION 1: ROULETTE. Name of Guesser Tally of Wins Tally of Losses # of Wins #1 #2

Using Cypress Resume. To access Cypress Resume visit your library s website:

Problem Set 4: Video Poker

Visual Quality Assessment using the IVQUEST software

Final Project (Choose 1 of the following) Max Score: A

Experiment 02 Interaction Objects

How to Customize Your Appointment Robot. Use this guide to discover how to customize your Appointment Robot landing pages.

Photo Contest New Jersey Press Association. The Complete Guide. New Jersey Press Association

CSci 1113, Spring 2018 Lab Exercise 13 (Week 14): Graphics part 2

Computer Science 25: Introduction to C Programming

Simulations. 1 The Concept

A. Rules of blackjack, representations, and playing blackjack

Risk. CSc 335 Final Project

Rules & Regulation. COUNTER STRIKE GLOBAL OFFENSIVE (1v1)

Add in a new ghost sprite, and a suitable stage backdrop.

Ok, we need the computer to generate random numbers. Just add this code inside your main method so you have this:

The Snipping Tool is automatically installed in Windows 7 and Windows 8.

Embedded Systems Lab

ELE 408 Final Project

EMERGE GAMING LAUNCHES ARCADE X EMERGE GAMING LAUNCHES ARCADE X : ASX MEDIA RELEASE 23 APRIL PAGE 1

CSC/MTH 231 Discrete Structures II Spring, Homework 5

ChordPolyPad Midi Chords Player iphone, ipad Laurent Colson

Easy Steps to My Best Bonus Offers by Sunny Suggs! Click here to join now!

20 LINES CREDITS PER LINE

ECE2049: Foundations of Embedded Systems Lab Exercise #1 C Term 2018 Implementing a Black Jack game

ANSYS v14.5. Manager Installation Guide CAE Associates

Problem F. Chessboard Coloring

Obstacle Dodger. Nick Raptakis James Luther ELE 408/409 Final Project Professor Bin Li. Project Description:

Assignment III: Graphical Set

Strings, Puzzle App I

CS 211 Project 2 Assignment

Batch Processing Converting images in a folder to JPEG

Supreme Hot Video Slot. Introduction. How to Bet. Gamble Feature

Introducing Photo Story 3

PaperCut PaperCut Payment Gateway Module - Nelnet Business Solutions Commerce Manager Quick Start Guide

NWN Toolset Module Construction Tutorial

DELIVERABLES. This assignment is worth 50 points and is due on the crashwhite.polytechnic.org server at 23:59:59 on the date given in class.

Problem A: Complex intersecting line segments

In this project you ll learn how to create a game, in which you have to match up coloured dots with the correct part of the controller.

/429 30, 2012, 9:30 AM 12:15 PM

Performance Task. Asteroid Aim. Chapter 8. Instructional Overview

CMSC 201 Fall 2018 Project 3 Sudoku

CitiTag Multiplayer Infrastructure

Making a Custom Symbol. Making a Custom Symbol in Chief Architect

Pass-Words Help Doc. Note: PowerPoint macros must be enabled before playing for more see help information below

Distributed Slap Jack

UW-Madison ACM ICPC Individual Contest

Q: WHAT ARE THE RESIDENCY REQUIREMENTS FOR THOSE WHO PLAY TO COMPETE? A: This is event is restricted to UK and Ireland, therefore:

Problem A Rearranging a Sequence

Mathematics Alignment Lesson

FREQUENTLY ASKED QUESTIONS

Transcription:

Lab4 Deadline: 18 Oct 2017 Information about php: Variable $_SERVER[ PHP_SELF ] Description The filename of the current script (relative to the root directory) Function string htmlspecialchars(string $s) int intval($var) int rand(int $m, int $n) Description Convert all special characters in the variable $s to HTML entities Return the integer value of $var Return a random integer number between $m and $n inclusively. Question 1 An overview of question 1 is given in Figure Q1_1. (non-first time visit: redirect to GuessingA.php) Start playgamea. php (First-time visit: redirect to settinga.html) settinga.html & setcookiesa.php GuessingA.php Figure Q1_1 Players first go to playgamea.php. In playgamea.php, cookie is searched to check if players have done the setting before. If player has not done the setting before, player will be redirected to settinga.html. In settinga.html, player will be required to set two parameters: the color channel for guessing (called c) and the maximum number of guesses (called maxno). These two parameters will be sent to setcookiesa.php when the submit button is clicked. In setcookiesa.php, the two parameters are stored as cookies. After that, player will be redirected to GuessingA.php. If player has cookies that contain c and maxno, player will be redirected to GuessingA.php. In GuessingA.php, player will have maxno maximum number of chances to guess the value for the color component c of a button. The color of the button can be specified by setting the RGB component. For example, if user has chosen green channel for guessing, GuessingA.php will generate a random number in between 0 and 255. The button s color can be set as

rgb(100,random number, 100). Player will then input his/her guess in a textbook and see if the guess is correct or not. Part A Create and complete playgamea.php. Note that this php file only aims to check if player has set c and maxno before. If so, player will be redirect to GuessingA.php. Otherwise, player will be redirected to settinga.html. Save your answer as playgamea.php. Part B The file settinga.html is given. You will need to create and complete the file setcookiesa.php. In setcookiesa.php, the two parameters input by the player in settinga.html will be saved as cookies. The cookies will be stored for one year in client s computer. After setting the cookies, player will be redirected to GuessingA.php. Save your answer as setcookiesa.php. Part C A partially completed GuessingA.php is given. In GuessingA.php, player will have maxno maximum number of chances to guess the value for the color component c of a button. As shown in Figure Q1_2, you have to get the user preferences from cookies (e.g., green and 5) and then display them in the browser output. Besides, a random number in the range of 0-255 (inclusive) will be generated. A button with color specified by this random number will be generated (under the heading The answer ). The button s color can be set as rgb(100, random number, 100) if player has chosen green channel for guessing. You can assume that values in the other two color channels are always set at 100. Save your answer as GuessingA_PartC.php.

Figure Q1_2 Part D The game in GuessingA.php works as follows: A player enters a number into the text field guess. After player clicks the submit button, the value is sent to the server (to the same file) for checking. The server will then send back the result to the player. If the number the player guesses is equal to the random number, the player wins as in Figure Q1_3. Note that a button is also created under the heading Your guess. This newly created button takes the user input in the text field guess as the color value in the c channel while values in the other two channels are set as 100. If the number the player guesses is not equal to the random number, a hint will be given as in Figure Q1_4 and Figure Q1_5. For example, if the number the player guesses is smaller than the random number, a hint is too small is shown as in Figure Q1_4. Besides a button is also created under the heading Your guess. This newly created button has color value specified by the user in the text field guess. This allows the player to compare the color specified by him/her and that from the true answer. The player has maxno chances to guess the number. The number of chances remain will be shown as in Figure Q1_4 and Figure Q1_5. If the player cannot make the correct guess within maxno chances, the player loses and the correct number will be shown as in Figure Q1_6. When the game is finished (i.e., either the player wins or loses), the submit button is disabled and the player cannot make further guess. You may refer to the soft copy of the handout for the color illustration. Save your answer as GuessingA_PartD.php.

Figure Q1_3 Figure Q1_4

Figure Q1_5 Figure Q1_6