create dice page

[size=14pt][b]please can you help me in this question ,

Create a dice page, that allow the user to enter an integer (from1 to 6) and the program must generate a random number (from1 to 6). if the random number equals the users’ entered number an image with smiley face must be displayed if not another image with sad face must be displayed. Also,you have to display the integer user entered and the program generated integer in the page.[/b][/size]

Show some effort in the actual code and people here will be glad to help you. It relatively easy if you think about it. You already did some of it already. Here’s some pseudo code:

  1. Player enters a number from 1 to 6 (Would require some kind of input - a form perhaps?)
  2. A computer randomly generates a number from 1 to 6 - A random number generator function?
  3. If numbers match then smiley face. :slight_smile: An if-then-else statement for the 3 & 4
  4. If number don’t match then a sad face. :frowning:

Though I personally would do something like this in JQuery (JavaScript) that is a client-side language rather than php which is a server-side language.

Sponsor our Newsletter | Privacy Policy | Terms of Service