diff --git a/00_Alternate_Languages/29_Craps/MiniScript/README.md b/00_Alternate_Languages/29_Craps/MiniScript/README.md index f52e8746..69e82be1 100644 --- a/00_Alternate_Languages/29_Craps/MiniScript/README.md +++ b/00_Alternate_Languages/29_Craps/MiniScript/README.md @@ -1,3 +1,16 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 craps.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 "craps" + run diff --git a/00_Alternate_Languages/31_Depth_Charge/MiniScript/README.md b/00_Alternate_Languages/31_Depth_Charge/MiniScript/README.md index f52e8746..af104703 100644 --- a/00_Alternate_Languages/31_Depth_Charge/MiniScript/README.md +++ b/00_Alternate_Languages/31_Depth_Charge/MiniScript/README.md @@ -1,3 +1,16 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 depthcharge.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 "depthcharge.ms" + run diff --git a/00_Alternate_Languages/32_Diamond/MiniScript/README.md b/00_Alternate_Languages/32_Diamond/MiniScript/README.md index f52e8746..552120d3 100644 --- a/00_Alternate_Languages/32_Diamond/MiniScript/README.md +++ b/00_Alternate_Languages/32_Diamond/MiniScript/README.md @@ -1,3 +1,16 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 diamond.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 "diamond" + run diff --git a/00_Alternate_Languages/33_Dice/MiniScript/README.md b/00_Alternate_Languages/33_Dice/MiniScript/README.md index f52e8746..abe65f49 100644 --- a/00_Alternate_Languages/33_Dice/MiniScript/README.md +++ b/00_Alternate_Languages/33_Dice/MiniScript/README.md @@ -1,3 +1,19 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 dice.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 "dice" + run + +3. "Try-It!" page on the web: +Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of dice.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/41_Guess/MiniScript/README.md b/00_Alternate_Languages/41_Guess/MiniScript/README.md index f52e8746..e8c6e3d2 100644 --- a/00_Alternate_Languages/41_Guess/MiniScript/README.md +++ b/00_Alternate_Languages/41_Guess/MiniScript/README.md @@ -1,3 +1,19 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 guess.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 "guess" + run + +3. "Try-It!" page on the web: +Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of guess.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/52_Kinema/MiniScript/README.md b/00_Alternate_Languages/52_Kinema/MiniScript/README.md index f52e8746..9052a1cb 100644 --- a/00_Alternate_Languages/52_Kinema/MiniScript/README.md +++ b/00_Alternate_Languages/52_Kinema/MiniScript/README.md @@ -1,3 +1,19 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 kinema.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 "kinema" + run + +3. "Try-It!" page on the web: +Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of kinema.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/54_Letter/MiniScript/README.md b/00_Alternate_Languages/54_Letter/MiniScript/README.md index f52e8746..b64d108a 100644 --- a/00_Alternate_Languages/54_Letter/MiniScript/README.md +++ b/00_Alternate_Languages/54_Letter/MiniScript/README.md @@ -1,3 +1,19 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 letter.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 "letter" + run + +3. "Try-It!" page on the web: +Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of letter.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/64_Nicomachus/MiniScript/README.md b/00_Alternate_Languages/64_Nicomachus/MiniScript/README.md index f52e8746..fd258393 100644 --- a/00_Alternate_Languages/64_Nicomachus/MiniScript/README.md +++ b/00_Alternate_Languages/64_Nicomachus/MiniScript/README.md @@ -1,3 +1,19 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 nicomachus.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 "nicomachus" + run + +3. "Try-It!" page on the web: +Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of nicomachus.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/66_Number/MiniScript/README.md b/00_Alternate_Languages/66_Number/MiniScript/README.md index f52e8746..230b0a4b 100644 --- a/00_Alternate_Languages/66_Number/MiniScript/README.md +++ b/00_Alternate_Languages/66_Number/MiniScript/README.md @@ -1,3 +1,19 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 number.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 "number" + run + +3. "Try-It!" page on the web: +Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of number.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/66_Number/MiniScript/number.ms b/00_Alternate_Languages/66_Number/MiniScript/number.ms index 23d88de3..0f242d68 100644 --- a/00_Alternate_Languages/66_Number/MiniScript/number.ms +++ b/00_Alternate_Languages/66_Number/MiniScript/number.ms @@ -38,7 +38,7 @@ while true end if if P > 500 then print "!!!!You win!!!! with " + P + " points." - exit + break end if print "You have " + P + " points."; print end while diff --git a/00_Alternate_Languages/78_Sine_Wave/MiniScript/README.md b/00_Alternate_Languages/78_Sine_Wave/MiniScript/README.md index f52e8746..98d5cac9 100644 --- a/00_Alternate_Languages/78_Sine_Wave/MiniScript/README.md +++ b/00_Alternate_Languages/78_Sine_Wave/MiniScript/README.md @@ -1,3 +1,16 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 sinewave.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 "sinewave" + run diff --git a/00_Alternate_Languages/87_3-D_Plot/MiniScript/README.md b/00_Alternate_Languages/87_3-D_Plot/MiniScript/README.md index f52e8746..e10c4f99 100644 --- a/00_Alternate_Languages/87_3-D_Plot/MiniScript/README.md +++ b/00_Alternate_Languages/87_3-D_Plot/MiniScript/README.md @@ -1,3 +1,16 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 number.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 "number" + run diff --git a/00_Alternate_Languages/91_Train/MiniScript/README.md b/00_Alternate_Languages/91_Train/MiniScript/README.md index f52e8746..bc083a8a 100644 --- a/00_Alternate_Languages/91_Train/MiniScript/README.md +++ b/00_Alternate_Languages/91_Train/MiniScript/README.md @@ -1,3 +1,19 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 train.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 "train" + run + +3. "Try-It!" page on the web: +Go to https://miniscript.org/tryit/, clear the default program from the source code editor, paste in the contents of train.ms, and click the "Run Script" button. diff --git a/00_Alternate_Languages/92_Trap/MiniScript/README.md b/00_Alternate_Languages/92_Trap/MiniScript/README.md index f52e8746..84dc58cd 100644 --- a/00_Alternate_Languages/92_Trap/MiniScript/README.md +++ b/00_Alternate_Languages/92_Trap/MiniScript/README.md @@ -1,3 +1,16 @@ Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 trap.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 "trap" + run diff --git a/00_Alternate_Languages/94_War/MiniScript/README.md b/00_Alternate_Languages/94_War/MiniScript/README.md new file mode 100644 index 00000000..d525f33e --- /dev/null +++ b/00_Alternate_Languages/94_War/MiniScript/README.md @@ -0,0 +1,16 @@ +Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html). + +Conversion to [MiniScript](https://miniscript.org). + +Ways to play: + +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 war.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 "war" + run diff --git a/00_Alternate_Languages/94_War/MiniScript/war.ms b/00_Alternate_Languages/94_War/MiniScript/war.ms new file mode 100644 index 00000000..acc43215 --- /dev/null +++ b/00_Alternate_Languages/94_War/MiniScript/war.ms @@ -0,0 +1,65 @@ +print " "*33 + "WAR" +print " "*15 + "CREATIVE COMPUTER MORRISTOWN, NEW JERSEY" +print; print; print + +print "This is the card game of War. Each card is given by SUIT-#" +print "as S-7 for Spade 7." + +// Get a yes/no (or at least y/n) response from the user. +askYesNo = function(prompt) + while true + answer = input(prompt + "? ").lower[:1] + if answer == "y" or answer == "n" then return answer + print "Answer yes or no, please." + end while +end function + +if askYesNo("Do you want directions") == "y" then + print "The computer gives you and it a 'card'. The higher card" + print "(numerically) wins. The game ends when you choose not to" + print "continue or when you have finished the pack." +end if +print +print + +cardValues = "2 3 4 5 6 7 8 9 10 J Q K A".split +deck = [] +for suits in "SHCD" + for value in cardValues + deck.push suits + "-" + value + end for +end for +deck.shuffle + +playerScore = 0 +computerScore = 0 + +while true + m1 = deck.pop + m2 = deck.pop + print "You: " + m1 + "; Computer: " + m2 + n1 = cardValues.indexOf(m1[2:]) + n2 = cardValues.indexOf(m2[2:]) + if n1 > n2 then + playerScore += 1 + print "You win. You have " + playerScore + " and the computer has " + computerScore + else if n2 > n1 then + computerScore += 1 + print "The computer wins!!! You have " + playerScore + " and the computer has " + computerScore + else + print "Tie. No score change." + end if + if not deck then break + if askYesNo("Do you want to continue") == "n" then break +end while + +if not deck then + print + print + print "We have run out of cards. Final score: You: " + playerScore + + " The computer: " + computerScore + print +end if +print "Thanks for playing. It was fun." +print + \ No newline at end of file