#!/usr/bin/perl use warnings; # crapz script by blumongoos # blumongo@m-net.arbornet.org # please keep credit to me if distributed # setting variables and accessing bankfile information $nick = ""; $fstroll = "0"; $scdroll = "0"; open(BANK, "bank.data") or die "Bank file innaccessable: $!\n"; $bank = <BANK>; $bet = "0"; # print banner print '***********************'; print "\n"; sleep 1; print '***********************'; print "\n"; print '***$$$**|CRAPZ|**$$$***'; print "\n"; sleep 1; print '********|-----|********'; print "\n"; print '***********************'; print "\n"; sleep 1; print '***********************'; print "\n"; print 'to exit enter quit'; print "\n"; print 'You have $'; print "$bank\n"; print 'What is your handle (name): '; chomp($nick = <STDIN>); # loop for the game while () { print 'Win or go home (type your bet or quit): '; chomp($bet = <STDIN>); if (($bet eq "quit") or ($bet eq "exit")) { open(SCORES, ">>scores.data"); print SCORES "$nick $bank\n"; print "\n"; print "SCOREBOARD\n"; print '----------'; print "\n"; open(RSCORES, "scores.data"); @scores = <RSCORES>; print @scores; last; } if ($bet > $bank) { print 'No cheating you are kicked out of the casino!'; print "\n"; last; } # generating random first roll srand; $fstroll = int(rand 11) + 1; if ( ($fstroll == '7') or ($fstroll == '11')) { sleep 1; print "You rolled a $fstroll\n"; $bank += $bet; print 'You stand at $'; print "$bank dollars\n"; } else { print "First roll was $fstroll\n"; $scdroll = int(rand 11) + 1; if ($scdroll != $fstroll) { $bank -= $bet; sleep 2; print "second roll $scdroll\n"; print 'You now have $'; print "$bank dollars\n"; sleep 2; } else { $bank += $bet; } } }

In reply to Crapz game by blumongoos

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.