Drug Wars for Tap Forms 5

Viewing 0 reply threads
  • Author
    Posts
  • November 12, 2021 at 11:18 PM #45678

    Sam Moffatt
    Participant

    The other day I had a random thought: could I port the old Drug Wars game that I used to play on my calculator over to Tap Forms 5? Since you’re reading this you probably guessed the answer is yes!

    For those not aware, Drug Wars was a popular game for the TI-82/TI-83/TI-84 series of graphical calculators that one might find in a high school maths class. I found a version of it online in a Gist and set to porting it over to Tap Forms.

    I used some of my prompter support functions (also available via Script Manager), added some helper functions to emulate what the calculator provides and mostly faithfully ported it into Javascript and Tap Forms 5 for Mac.

    Note: this won’t work on iOS because Utils.alertWithMessage on iOS doesn’t block like it does on the Mac. Hopefully Brendan can figure out how to make that consistent, or suggest a change to make it work, so that you can use Tap Forms for iOS and iPadOS to also play the game.

    If you’re interested in checking it out, it’s here in a Gist on GitHub: https://gist.github.com/pasamio/3238964489c6594ab1983b7aaa02b91b

    As a note, it’s a Javascript almost lines for line replication of what the original TI-BASIC programming. It’s hampered a little because TI-BASIC has labels/goto whilst Javascript doesn’t provide that feature (probably because goto considered harmful) so that leads to more creative solutions to flow control. There’s an elegance in how the spaghetti code in TI-BASIC works that perhaps reminds us how things used to be.

    And now to ping the keymaster because I’m sure this post will get flagged…

    • This topic was modified 2 years, 4 months ago by Sam Moffatt.
    • This topic was modified 2 years, 4 months ago by Sam Moffatt.
Viewing 0 reply threads

You must be logged in to reply to this topic.