Skip to content

Commit f7ea184

Browse files
Merge pull request #902 from JoeStrout/miniscript-batch-8
Miniscript batch 8
2 parents a4b68e4 + 55ec081 commit f7ea184

File tree

31 files changed

+1859
-22
lines changed

31 files changed

+1859
-22
lines changed

00_Alternate_Languages/59_Lunar_LEM_Rocket/MiniScript/rocket.ms

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ end function
4141
// Bonus little feature when running in Mini Micro: display a header bar
4242
// always at the top of the screen.
4343
drawHeaders = function
44+
if version.hostName != "Mini Micro" then return
4445
display(2).mode = displayMode.text; td = display(2)
4546
td.color = text.color; td.backColor = color.black
4647
td.row = 25; td.column = 0
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html).
2+
3+
Conversion to [MiniScript](https://miniscript.org).
4+
5+
Ways to play:
6+
7+
1. Command-Line MiniScript:
8+
Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as:
9+
```
10+
miniscript pizza.ms
11+
```
12+
13+
2. Mini Micro:
14+
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 MiniScript program and this README file. Then, at the Mini Micro command prompt, enter:
15+
```
16+
load "pizza"
17+
run
18+
```
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
print " "*33 + "Pizza"
2+
print " "*15 + "Creative Computing Morristown, New Jersey"
3+
print; print; print
4+
print "Pizza Delivery Game"; print
5+
name = input("What is your first name? "); print
6+
print "Hi, " + name + ". In this game you are to take orders"
7+
print "for pizzas. Then you are to tell a delivery boy"
8+
print "where to deliver the ordered pizzas."; print; print
9+
10+
// Convert a house name like "G" into coordinates like [3,2].
11+
nameToCoords = function(name)
12+
idx = name.code - "A".code
13+
row = floor(idx / 4)
14+
col = idx % 4
15+
return [col+1, row+1]
16+
end function
17+
18+
// Convert house coordinates like [3,2] into a house name like "G".
19+
coordsToName = function(coords)
20+
idx = (coords[1]-1)*4 + (coords[0]-1)
21+
return char("A".code + idx)
22+
end function
23+
24+
askYesNo = function(prompt)
25+
while true
26+
yn = input(prompt + "? ").lower + " "
27+
if yn[0] == "y" then return "yes"
28+
if yn[0] == "n" then return "no"
29+
print "'Yes' or 'no' please, now then,"
30+
end while
31+
end function
32+
33+
input "(Press Return.)"; print
34+
35+
print "Map of the city of Hyattsville"; print
36+
print " -----1-----2-----3-----4-----"
37+
for row in range(4, 1)
38+
print "-"; print "-"; print "-"
39+
s = row + " "
40+
for col in range(1, 4)
41+
s += coordsToName([col, row]) + " "
42+
end for
43+
s += row
44+
print s
45+
end for
46+
print "-"; print "-"; print "-"
47+
print " -----1-----2-----3-----4-----"
48+
49+
input
50+
print "The output is a map of the homes where"
51+
print "you are to send pizzas."; print
52+
print "Your job is to give a truck driver"
53+
print "the location or coordinates of the"
54+
print "home ordering the pizza."; print
55+
if askYesNo("Do you need more directions") == "yes" then
56+
print; print "Somebody will ask for a pizza to be"
57+
print "delivered. Then a delivery boy will"
58+
print "ask you for the location.";
59+
print " Example:"
60+
print "This is J. Please send a pizza."
61+
print "Driver to " + name + ". Where does j live?"
62+
print "Your answer would be 2,3"; print
63+
if askYesNo("Understand") == "no" then
64+
print "This job is definitely too difficult for you. Thanks anyway"
65+
exit
66+
end if
67+
print "Good. you are now ready to start taking orders."; print
68+
print "Good luck!!"; print
69+
end if
70+
71+
while true
72+
for turn in range(1,5)
73+
coords = [floor(rnd*4+1), floor(rnd*4+1)]
74+
buyer = coordsToName(coords)
75+
print "Hello " + name + "'s Pizza. This is " + buyer +
76+
". Please send a pizza."
77+
while true
78+
while true
79+
inp = input(" Driver to " + name + ": Where does " + buyer + " live? ")
80+
inp = inp.replace(",", " ").replace(" ", " ")
81+
inp = inp.split + [0,0]
82+
guess = [inp[0].val, inp[1].val]
83+
if 1 <= guess[0] <= 4 and 1 <= guess[1] <= 4 then break
84+
end while
85+
if guess == coords then
86+
print "Hello " + name + ". This is " + buyer + ", thanks for the pizza."
87+
break
88+
else
89+
print "This is " + coordsToName(guess) + ". I did not order a pizza."
90+
print "I live at " + guess.join(",")
91+
end if
92+
end while
93+
print
94+
end for
95+
if askYesNo("Do you want to deliver more pizzas") == "no" then break
96+
end while
97+
98+
print; print "O.K. " + name + ", see you later!"; print
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html).
2+
3+
Conversion to [MiniScript](https://miniscript.org).
4+
5+
Ways to play:
6+
7+
1. Command-Line MiniScript:
8+
Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as:
9+
```
10+
miniscript poetry.ms
11+
```
12+
13+
2. Mini Micro:
14+
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 MiniScript program and this README file. Then, at the Mini Micro command prompt, enter:
15+
```
16+
load "poetry"
17+
run
18+
```
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
print " "*30 + "POETRY"
2+
print " "*15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
3+
print; print; print
4+
5+
I = 0; J = 0; K = 0; U = 0
6+
7+
// Note: infinite loop. Press control-C to break.
8+
while true
9+
if J == 1 then
10+
print ["MIDNIGHT DREARY", "FIERY EYES",
11+
"BIRD OR FIEND", "THING OF EVIL", "PROPHET"][I-1], ""
12+
else if J == 2 then
13+
if I == 1 or I == 4 then U = 2
14+
if I == 3 then U = 0
15+
print ["BEGUILING ME", "THRILLED ME",
16+
"STILL SITTING....", "NEVER FLITTING", "BURNED"][I-1], ""
17+
else if J == 3 then
18+
if U != 0 or I < 5 then
19+
print ["AND MY SOUL", "DARKNESS THERE",
20+
"SHALL BE LIFTED", "QUOTH THE RAVEN", "SIGN OF PARTING"][I-1], ""
21+
end if
22+
else if J == 4 then
23+
print ["NOTHING MORE", "YET AGAIN",
24+
"SLOWLY CREEPING", "...EVERMORE", "NEVERMORE"][I-1], ""
25+
end if
26+
if U != 0 and rnd <= 0.19 then
27+
print ",", ""
28+
U = 2
29+
end if
30+
if rnd <= 0.65 then
31+
print " ", ""
32+
U += 1
33+
else
34+
print
35+
U = 0
36+
end if
37+
while true
38+
I =floor(floor(10*rnd)/2)+1
39+
J += 1
40+
K += 1
41+
if U == 0 and floor(J/2) == J/2 then print " ", ""
42+
if J <= 5 then break
43+
J = 0
44+
print
45+
if K <= 20 then continue
46+
print
47+
U = 0
48+
K = 0
49+
break
50+
end while
51+
end while
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html).
2+
3+
Conversion to [MiniScript](https://miniscript.org).
4+
5+
Ways to play:
6+
7+
1. Command-Line MiniScript:
8+
Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as:
9+
```
10+
miniscript poker.ms
11+
```
12+
13+
2. Mini Micro:
14+
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 MiniScript program and this README file. Then, at the Mini Micro command prompt, enter:
15+
```
16+
load "poker"
17+
run
18+
```

0 commit comments

Comments
 (0)