08-02-2022, 12:58 PM
(This post was last modified: 08-02-2022, 01:17 PM by James D Jarvis.)
This is a recreation of the first computer program (and first game) I ever wrote about 40 years ago. It's uses a couple of new-fangled features but is as close as I can remember it.
The original requirements for the assignment was a math function, and user input .
The original requirements for the assignment was a math function, and user input .
Code: (Select All)
'oldshowdown
'This is a recreation of my very first basic game as best as I can recall.
'originally written in math class on an apple computer in the 7th or 8th grade
'nothing amazing, just personal computing archeology of a sort
Randomize Timer
Cls
Dim p$(3)
For x = 20 To 1 Step -1
_Limit 10
Cls
For y = 1 To x
Print
Next
Print " S H O W D O W N"
_Display
Next
Print: Print
Print " Well Pardner the time has come, Black Bart is calling you out."
_Delay 0.25
Print
Print " You strap on your trusty six-shooter and walk out into the street."
_Delay 0.25
givehint:
hint = Int(1 + Rnd * 3)
p$(1) = " The sun is in your eyes."
p$(2) = " Everything is silent except for a dog barking in the distance."
p$(3) = " Buzzards circle high above the dusty street..."
Print p$(hint)
hint = hint * 3
_Delay 0.25
shoot:
Print " Pick a number from 1 to 9 to fire your shooting iron."
Input s$
sn = Val(s$)
Print
bartshot = Int(1 + Rnd * hint)
Print "Both shots ring out... "
_Delay 0.5
If sn = bartshot Then GoTo youwon
If sn < bartshot Then GoTo bartwon
If sn > bartshot Then GoTo fighton
bartwon:
Print " ... the last thing you hear is Black Bart laughing."
Print
End
youwon:
Print " ... Black Bart smiles..."
_Delay 0.5
Print " ... before dropping where he stands."
Print
Print "The street fills with the townsfolk slapping you on the back and cheering."
Print
End
fighton:
Print "Both of your shots have gone wild, Black Bart shifts to the side and pulls the hammer back on his revolver..."
Print
GoTo givehint