hi, I am trying to make a simple craps game. and would appreciate some help

#index.html#
<html> <center> <img src=./pix/submit.jpg> <hr> <form action=/cgi-bin/dice.cgi method=post> <input type=submit value ="roll the dice" > <a href= cgi-bin/dice.cgi> </center> </html>

this next piece I would like to add an animated .gif that simulates the dice rolling then show the numbers if you would like to see them the url is http://s1215.photobucket.com/albums/cc505/troylolson/ all the .gif's are renamed correctly for this script

dice.cgi

#! /usr/bin/perl use CGI ':standard'; print "Content-type:html\n\n"; $dice1= int (rand(6)+1); $dice2= int (rand(6)+1); $rolla = param('rolla'); $rollb = param('rollb'); print "<img src=http://localhost/pix/dice$dice1.gif>"; print "<img src=http://localhost/pix/dice$dice2.gif>"; $total= $dice1+$dice2; print "your first roll was" ; print "<img src=http://localhost/pix/dice$rolla.gif>"; #rollb won't show up# print "<img src=http://localhost/pix/dice$rollb.gif>"; if (($total ==7)or($total ==11)){ print "you win!!!"; exit() } elsif (($total ==2) or ($total ==12)){ print "loser"; exit() } #I believe the problem with rollb is on this line# print "<a href= dice.cgi?rolla=$dice1 & rollb=$dice2>roll again</a>"

I also need to add some kind of counter so it remembers the first roll only. the counter and a few tweaks for the rules I am not worried about as much as a way to swap the animated .gif with the correct die face after the .gif has played through. thank you for your time


In reply to dice game by friar tux

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.