I was bored the other day so I decided to port the game "Dukedom" from C to Perl. Here is the result, I'd greatly appreciate comments/feedback on how to make it display agnostic so it can be used for websites, Tk, etc. besides command line scripts. I have code refs now that can be changed out, but I'm pretty sure I need to do more. I am toying with using exception objects to signal the need for display/input and to provide callbacks to re-enter the state machine at the proper point.

Please keep in mind that this is only the first draft and no docs or tests have been written yet. However, the command line script will work and allow you to play the game.

https://github.com/boftx/Games-Dukedom

You can find the original code that I ported from here: https://github.com/caryo/Dukedom/blob/master/imports/dukedom.c

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

In reply to A port of "Dukedom" to Perl by boftx

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.