A LOTTERY GAME Assignment P2 IST210 1. Guideline Use the PHP you learnt in class to make a PHP page https://my.up.ist.psu.edu/duw24/lottery.php Game rules:

Slides:



Advertisements
Similar presentations
» PHP arrays are lists of values stored in key-value pairs. » Uses of arrays: Many built-in PHP environment variables. Database functions use arrays.
Advertisements

HTML Form and PHP IST Review of Previous Class HTML table and PHP array Winner is chosen automatically using rand() function.
Essential Question: If you flip a coin 50 times and get a tail every time, what do you think you will get on the 51st time? Why?
Parrondo’s Paradox Noel-Ann Bradshaw University of Greenwich.
This game is loosely based on the Whack-A- Mole arcade game.  Each game starts with 45 seconds of play.  Moles randomly pop out of holes on the landscape.
6. More on the For-Loop Using the Count Variable Developing For-Loop Solutions.
Review for midterm exam Dilshad M. Shahid Spring NYU.
St. Bonaventure University PowerPoint Notes The Basics and Some Hints for Creating an Effective Presentation.
PHP and SQL Server: Queries IST2101. Three-Tier Architecture Three-tier architecture means that the Web server and the DBMS are on separate servers IST2102.
CS 1150 – JavaScript Programming Lab TA – Sanjaya Wijeratne – Web Page -
LO: Learn how to develop your game further to include interactions with the device.
Craps!. Example: A Game of Chance Craps simulator Rules – Roll two dice 7 or 11 on first throw, player wins 2, 3, or 12 on first throw, player loses 4,
Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.
THE BIG PICTURE. How does JavaScript interact with the browser?
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Outside Interests Disclosure Form Instructions. Table of Contents Stages New Submission (2 slides)New Submission Supervisor/Department Head (2 slides)Supervisor/Department.
Week 7. Lecture 2 Functions, Arrays, PHP&MySQL. Function with More than one argument and a return statement For a function to return a value, the return.
Write down your choice of 5 different numbers between 1 and 36 Three ways to win. –In any order match: All 5 4 out of 5 3 out of 5 –Prize: Giant Book.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Understanding Randomness.
HTML Table and PHP Array
PHP Logic. Review: Variables Variables: a symbol or name that stands for a value – Data types ( Similar to C++ or Java): Int, Float, Boolean, String,
4.3 Binomial Distributions. Red Tiles and Green Tiles in a Row You have 4 red tiles and 3 green tiles. You need to select 4 tiles. Repeated use of a tiles.
HTML Form and PHP IST Review of Previous Class HTML table and PHP array Winner is chosen randomly using rand() function.
Programming Assignment 3 Add forms in your web page so that visitors can add a comment about your web page – Example:
Chapter 7: Random Variables “Horse sense is what keeps horses from betting on what people do.” Damon Runyon.
Dynamic web content HTTP and HTML: Berners-Lee’s Basics.
Computational Boot Camp HTML Mike Schaffer. 8/23/2002 (MES) HTML What is HTML? HTML stands for HyperText Markup Language HTML is the language for publishing.
Algorithms Writing instructions in the order they should execute.
Probability Evaluation 11/12 th Grade Statistics Fair Games Random Number Generator Probable Outcomes Resources Why Fair Games? Probable Outcome Examples.
Exercise 1: IF/ELSE Step 1: Open NotePad++ and create “number.php” in your webspace Step 2: Write codes to do the following 1.Generate a random number.
Name: Date: Period: Topic: Patterns and Linear Functions Essential Question: How can you represent and describe functions? Warm-Up : 1. The average price.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
CST336, Dr. Krzysztof Pietroszek Week 2: PHP. 1.Introduction to PHP 2.Embed PHP code into an HTML web page 3.Generate (output HTML) web page using PHP.
 A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests.
 A PHP script can be placed anywhere in the document.  A PHP script starts with  The default file extension for PHP files is ".php".  A PHP file normally.
1 Project 3: Farey Sequences. 2 Farey Sequences Further details about Farey sequences, and more examples, can be found in the Wikipedia article:
HTML FORM Lab Exercise IST Guideline Add forms in your web page so that visitors can add a comment about your web page Forms should include the.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
HTML FORM AND PHP IST 210: Organization of Data IST210 1.
ICT/COMPUTING RULES Only use software allowed by the teacher
PHP ARRAY AND HTML TABLE IST 210 Organization of Data IST210 1.
L6. More on the For-Loop Using the Count Variable Developing For-Loop Solutions.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
Basic Probabilities Starting Unit 6 Today!. Definitions  Experiment – any process that generates one or more observable outcomes  Sample Space – set.
 Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do.
First Steps in PHP Creating Very Simple PHP Scripts SoftUni Team Technical Trainers Software University
Programming for the Web Assignment One Dónal Mulligan BSc MA
IST 210: PHP Logic IST 210: Organization of Data IST2101.
HTML FORM Assignment P4 IST Guideline Add forms in your web page so that visitors can add a comment about your web page Forms should include the.
PHP Condtions and Loops Prepared by Dr. Maher Abuhamdeh.
Programming Assignment 4: HTML Table and PHP Array.
BSA 500 Week 6 Learning Team Assignment Riordan Manufacturing Paper and Presentation Resource: Riordan Manufacturing Virtual Organization Finalize and.
BSA 411 Week 3 Individual Assignment Modeling Methodologies Modeling Methodologies Submit a 3- to 4-page paper consisting of the following: Continuing.
BSA 411 Week 4 Individual Assignment Process Analysis and System Concept Development Process Analysis and System Concept Development Submit a 3- to 4-page.
Session 2 Basics of PHP.
Expected values of games
>> Introduction to CSS
Modelling and Simulating Social Systems with MATLAB
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Diamond Hunt Mock Programming Project.
Sample to correct Test box with subtitle.
Creating Variables Output Logic flow Operators (More) Basic blocks
4/25/2012 Your Quarterly Project
Game Over Module 4 Lesson 2.
Project and Assignment Submission
Guidelines for preparing your slides:
Chapter 16 OOP PHP Part 1.
Exam #2 covering Sections 11 to 15 - NEXT CLASS!
Guidelines for preparing your slides:
Presentation transcript:

A LOTTERY GAME Assignment P2 IST210 1

Guideline Use the PHP you learnt in class to make a PHP page Game rules: Generate a random number x in [1,3] as the lucky number Generate a random number y in [1,3] as your number If y is the same as x, output “you win the game” y times in different headings; otherwise, output “lose the game” y times in different headings See next two slides for more details IST210 2

3 Heading 1 Font of the number: color red, size 5 Font of the number: color green, size 5 Font: color green in heading 1,2,3 Repeat 3 times (because your number is the same as the lucky number- you win- and 3 is the your random number)

IST210 4 Heading 1 Font of the number: color red, size 5 Font of the number: color green, size 5 Font: color red, heading 1,2 Repeat 2 times (because 2 is the your random number)

Hint Use rand(1,3) to generate a random number in [1,3] Use two variables, $x and $y, to store the rand number Use IF/ELSE to check whether $x and $y is the same Use FOR loop to echo the results $y times IST210 5

More hint IST210 6 <?php $x = rand(1,10); echo "The first random number is $x "; echo " "; $y = rand(1,10); echo "The second random number is $y "; ?> Random number between 1 and 10 Font: color red, size 5 Random number between 1 and 10 Font: color green, size 5

Submit Submit to ANGEL in Assignment P2 Your php script (as attachment) Link to the webpage you made (in the submission ) IST210 7