Win $100 Million USD

 

Random Dice roller

this example shows how to generate random numbers and uses images of dice to simulate dice rolling .

Here is the code for the example

<%
'declare our variables
Dim intDie1 , intDie2 , intSum
'generate random numbers
Randomize
intDie1 = Int(6 * Rnd + 1)
intDie2 = Int(6 * Rnd + 1)
'display dice 1
Response.Write "<img src=""images/" & intDie1 & ".gif" & """>"
Response.Write "You threw a " & intDie1 & "<br>"
'display dice number 2
Response.Write "<img src=""images/" & intDie2 & ".gif" &""">"
Response.Write "You threw a " & intDie2 & "<br>"

If intDie1 = intDie2 Then
Response.Write "You threw a double well done" & "<br>"
End If

%>

 


Here are the images for your usage

Sponsors