mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-12 15:50:20 -08:00
Fixed some minor issues with weekday.ms.
This commit is contained in:
@@ -6,11 +6,12 @@ Ways to play:
|
|||||||
|
|
||||||
1. Command-Line MiniScript:
|
1. Command-Line MiniScript:
|
||||||
Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as:
|
Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as:
|
||||||
|
```
|
||||||
miniscript weekday.ms
|
miniscript weekday.ms
|
||||||
|
```
|
||||||
2. Mini Micro:
|
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 MiniScript program and this README file. Then, at the Mini Micro command prompt, enter:
|
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:
|
||||||
|
```
|
||||||
load "weekday"
|
load "weekday"
|
||||||
run
|
run
|
||||||
|
```
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
TAB = char(9)
|
TAB = char(9)
|
||||||
CR = char(13)
|
|
||||||
|
|
||||||
Age = {"m": 0, "d": 0, "y": 0}
|
Age = {"m": 0, "d": 0, "y": 0}
|
||||||
Age.init = function(m,d,y)
|
Age.init = function(m,d,y)
|
||||||
@@ -107,15 +106,18 @@ Date._leapYears = function
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
print " "*32 + "WEEKDAY"
|
print " "*32 + "WEEKDAY"
|
||||||
print " "*15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"+CR+CR+CR
|
print " "*15 + "Creative Computing Morristown, New Jersey"
|
||||||
|
print; print; print
|
||||||
|
|
||||||
print "WEEKDAY is a computer demonstration that"
|
print "WEEKDAY is a computer demonstration that"
|
||||||
print "gives facts about a date of interest to you."+CR
|
print "gives facts about a date of interest to you."
|
||||||
|
print
|
||||||
|
|
||||||
mdy = input("Enter today's date in the form: 3,24,1979?"+CR)
|
mdy = input("Enter today's date in the form: 3,24,1979? ")
|
||||||
today = Date.init(mdy)
|
today = Date.init(mdy)
|
||||||
|
|
||||||
mdy = input("Enter day of birth (or other day of interest)"+CR)
|
|
||||||
|
mdy = input("Enter day of birth (or other day of interest)? ")
|
||||||
dob = Date.init(mdy)
|
dob = Date.init(mdy)
|
||||||
|
|
||||||
print
|
print
|
||||||
@@ -139,6 +141,8 @@ age = today.diff(dob)
|
|||||||
|
|
||||||
totalAge = Age.init(age.m,age.d,age.y)
|
totalAge = Age.init(age.m,age.d,age.y)
|
||||||
if verb == " was a " then
|
if verb == " was a " then
|
||||||
|
if dob.d == today.d and dob.m == today.m then print "***HAPPY BIRTHDAY***"
|
||||||
|
|
||||||
lines= [["", "YEARS", "MONTHS", "DAYS"]]
|
lines= [["", "YEARS", "MONTHS", "DAYS"]]
|
||||||
lines.push(["", "-----", "------", "----"])
|
lines.push(["", "-----", "------", "----"])
|
||||||
lines.push(["Your age (if birthdate)", age.y,age.m, age.d])
|
lines.push(["Your age (if birthdate)", age.y,age.m, age.d])
|
||||||
@@ -174,4 +178,5 @@ if verb == " was a " then
|
|||||||
end for
|
end for
|
||||||
end if
|
end if
|
||||||
|
|
||||||
print CR+"Yoy may retire in " + (dob.y + 65)
|
print
|
||||||
|
print " "*16 + "*** Yoy may retire in " + (dob.y + 65) + " ***"
|
||||||
|
|||||||
@@ -6,11 +6,12 @@ Ways to play:
|
|||||||
|
|
||||||
1. Command-Line MiniScript:
|
1. Command-Line MiniScript:
|
||||||
Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as:
|
Download for your system from https://miniscript.org/cmdline/, install, and then run the program with a command such as:
|
||||||
|
```
|
||||||
miniscript word.ms
|
miniscript word.ms
|
||||||
|
```
|
||||||
2. Mini Micro:
|
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 MiniScript program and this README file. Then, at the Mini Micro command prompt, enter:
|
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:
|
||||||
|
```
|
||||||
load "word"
|
load "word"
|
||||||
run
|
run
|
||||||
|
```
|
||||||
@@ -20,7 +20,7 @@ of orbit < ^ ship
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The distance of the bomb from the ship is computed using the law of consines. The law of cosines states:
|
The distance of the bomb from the ship is computed using the law of cosines. The law of cosines states:
|
||||||
|
|
||||||
```
|
```
|
||||||
D = SQUAREROOT( R**2 + D1**2 - 2*R*D1*COS(A-A1) )
|
D = SQUAREROOT( R**2 + D1**2 - 2*R*D1*COS(A-A1) )
|
||||||
|
|||||||
Reference in New Issue
Block a user