Thanks for posting the game. Honestly, I've never had the patience to work through one of those slider games. But it's fun to see the game presented in Perl.

I did want to contribute a few suggestions that might both improve the game as well as your code overall. You'll find that to implement my suggestions probably means a complete rewrite. But if you take a few of these suggestions with you to your next project you'll end up with cleaner, more robust, easier to handle code.

There are probably other things to discuss, but these are the ones that jumped out at me first. Again, I'm not trying to criticize your code. I think it's a fun implementation of a well known game. I just offer these tips so that you might have an easier time of making a more robust program next time around. I'm no expert myself. But as someone who was at the level of your code not too long ago, I just wanted to help point you in the right direction in tackling the learning curve.

Keep up the good work. As long as we're all learning all of our efforts are worthwhile. Keep having fun with it.

Dave

"If I had my life to do over again, I'd be a plumber." -- Albert Einstein


In reply to Re: Puzzle by davido
in thread Puzzle by Anonymous Monk

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.