From 547aa39a2c376c45d92bf6c7d98522156cb88984 Mon Sep 17 00:00:00 2001 From: JoeStrout Date: Wed, 26 Jul 2023 15:36:09 -0700 Subject: [PATCH] Added MiniScript version of 25_Chief. --- .../25_Chief/MiniScript/README.md | 21 ++++++++ .../25_Chief/MiniScript/chief.ms | 50 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 00_Alternate_Languages/25_Chief/MiniScript/README.md create mode 100644 00_Alternate_Languages/25_Chief/MiniScript/chief.ms diff --git a/00_Alternate_Languages/25_Chief/MiniScript/README.md b/00_Alternate_Languages/25_Chief/MiniScript/README.md new file mode 100644 index 00000000..f31bfa51 --- /dev/null +++ b/00_Alternate_Languages/25_Chief/MiniScript/README.md @@ -0,0 +1,21 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). + +NOTE: I have added `wait` statements before and while printing the lightning bolt, without which it appears too quickly to be properly dramatic. + +Ways to play: + +0. Try-It! Page: +Go to https://miniscript.org/tryit/, clear the sample code from the code editor, and paste in the contents of chief.ms. Then click the "Run Script" button. Program output (and input) will appear in the green-on-black terminal display to the right of or below the code editor. + +1. Command-Line MiniScript: +Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as: + + miniscript chief.ms + +2. Mini Micro: +Download Mini Micro from https://miniscript.org/MiniMicro/, launch, and then click the top disk slot and chose "Mount Folder..." Select the folder containing the BASIC program. Then, at the Mini Micro command prompt, enter: + + load "chief" + run diff --git a/00_Alternate_Languages/25_Chief/MiniScript/chief.ms b/00_Alternate_Languages/25_Chief/MiniScript/chief.ms new file mode 100644 index 00000000..272e6699 --- /dev/null +++ b/00_Alternate_Languages/25_Chief/MiniScript/chief.ms @@ -0,0 +1,50 @@ +print " "*30 + "Chief" +print " "*15 + "Creative Computing Morristown, New Jersey" +print; print; print +print "I am chief Numbers Freek, the great Indian math god." +yn = input("Are you ready to take the test you called me out for? ").lower +if not yn or yn[0] != "y" then + print "Shut up, pale face with wise tongue." +end if +print " Take a number and add 3. Divide this number by 5 and" +print "multiply by 8. Divide by 5 and add the same. Subtract 1." +b = input(" What do you have? ").val +c = (b+1-5)*5/8*5-3 +yn = input("I bet your number was " + c + ". Am I right? ").lower +if yn and yn[0] == "y" then + print "Bye!!!" +else + k = input("What was your original number? ").val + f=k+3 + g=f/5 + h=g*8 + i=h/5+5 + j=i-1 + print "So you think you're so smart, eh?" + print "Now watch." + print k + " plus 3 equals " + f +". This divided by 5 equals " + g + ";" + print "this times 8 equals " + h + ". If we divide by 5 and add 5," + print "we get " + i + ", which, minus 1, equals " + j + "." + yn = input("Now do you believe me? ").lower + if yn and yn[0] == "y" then + print "Bye!!!" + else + print "You have made me mad!!!" + print "There must be a great lightning bolt!" + print; print; wait 2 + for x in range(30, 22) + print " "*x + "x x"; wait 0.1 + end for + print " "*21 + "x xxx"; wait 0.1 + print " "*20 + "x x"; wait 0.1 + print " "*19 + "xx x"; wait 0.1 + for y in range(20, 13) + print " "*y + "x x"; wait 0.1 + end for + print " "*12 + "xx"; wait 0.1 + print " "*11 + "x"; wait 0.1 + print " "*10 + "*"; wait 0.1 + print; print"#########################"; print + print "I hope you believe me now, for your sake!!" + end if +end if