mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-10 12:14:41 -08:00
MAINT: Apply pre-commit
Remove byte-order-marker pre-commit check as there would be many adjustments necessary
This commit is contained in:
@@ -2,7 +2,7 @@ Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/gam
|
||||
|
||||
Conversion to [Microsoft C#](https://docs.microsoft.com/en-us/dotnet/csharp/)
|
||||
|
||||
This C# implementation of slots was done using a [C# script](https://github.com/filipw/dotnet-script).
|
||||
This C# implementation of slots was done using a [C# script](https://github.com/filipw/dotnet-script).
|
||||
|
||||
# Required
|
||||
[.NET Core SDK (i.e., .NET 6.0)](https://dotnet.microsoft.com/en-us/download)
|
||||
@@ -15,4 +15,4 @@ dotnet tool install -g dotnet-script
|
||||
# Run
|
||||
```
|
||||
dotnet script .\slots.csx
|
||||
```
|
||||
```
|
||||
|
||||
@@ -49,7 +49,7 @@ public void Play()
|
||||
}
|
||||
}
|
||||
else if(x == y)
|
||||
{
|
||||
{
|
||||
if(y == Slot.BAR)
|
||||
{
|
||||
DoubleBar(bet);
|
||||
@@ -57,7 +57,7 @@ public void Play()
|
||||
else
|
||||
{
|
||||
Double(bet);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(x == z)
|
||||
{
|
||||
|
||||
@@ -12,10 +12,10 @@ function input()
|
||||
{
|
||||
var input_element;
|
||||
var input_str;
|
||||
|
||||
|
||||
return new Promise(function (resolve) {
|
||||
input_element = document.createElement("INPUT");
|
||||
|
||||
|
||||
print("? ");
|
||||
input_element.setAttribute("type", "text");
|
||||
input_element.setAttribute("length", "50");
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
#
|
||||
########################################################
|
||||
|
||||
from random import choices
|
||||
from collections import Counter
|
||||
import sys
|
||||
from collections import Counter
|
||||
from random import choices
|
||||
|
||||
|
||||
def initial_message():
|
||||
print(" "*30 + "Slots")
|
||||
print(" "*15 + "Creative Computing Morrison, New Jersey")
|
||||
print("\n"*3)
|
||||
print(" " * 30 + "Slots")
|
||||
print(" " * 15 + "Creative Computing Morrison, New Jersey")
|
||||
print("\n" * 3)
|
||||
print("You are in the H&M Casino, in front of one of our")
|
||||
print("one-arm Bandits. Bet from $1 to $100.")
|
||||
print("To pull the arm, punch the return key after making your bet.")
|
||||
@@ -65,7 +65,7 @@ def beeping():
|
||||
# Function to produce a beep sound.
|
||||
# In the original program is the subroutine at line 1270
|
||||
for _ in range(5):
|
||||
sys.stdout.write('\a')
|
||||
sys.stdout.write("\a")
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
@@ -89,10 +89,10 @@ def adjust_profits(wheel, m, profits):
|
||||
|
||||
if fruit == "Bar":
|
||||
print("\n***Jackpot***")
|
||||
profits = (((100*m)+m)+profits)
|
||||
profits = ((100 * m) + m) + profits
|
||||
else:
|
||||
print("\n**Top Dollar**")
|
||||
profits = (((10*m)+m)+profits)
|
||||
profits = ((10 * m) + m) + profits
|
||||
|
||||
print("You Won!")
|
||||
elif len(s) == 2:
|
||||
@@ -103,10 +103,10 @@ def adjust_profits(wheel, m, profits):
|
||||
|
||||
if fruit == "Bar":
|
||||
print("\n*Double Bar*")
|
||||
profits = (((5*m)+m)+profits)
|
||||
profits = ((5 * m) + m) + profits
|
||||
else:
|
||||
print("\nDouble!!")
|
||||
profits = (((2*m)+m)+profits)
|
||||
profits = ((2 * m) + m) + profits
|
||||
|
||||
print("You Won!")
|
||||
else:
|
||||
@@ -135,7 +135,7 @@ while keep_betting:
|
||||
w = spin_wheels()
|
||||
profits = adjust_profits(w, m, profits)
|
||||
|
||||
print("Your standings are ${}".format(profits))
|
||||
print(f"Your standings are ${profits}")
|
||||
answer = input("Again?")
|
||||
|
||||
try:
|
||||
|
||||
@@ -91,7 +91,7 @@ while true
|
||||
else
|
||||
# valid bet, continue
|
||||
tenBells # ding
|
||||
|
||||
|
||||
# assign a random value from the array to each of the three reels
|
||||
reel1 = reelArray[rand(5)]
|
||||
reel2 = reelArray[rand(5)]
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
180 IF M>100 THEN 860
|
||||
190 IF M<1 THEN 880
|
||||
200 M=INT(M)
|
||||
210 GOSUB 1270
|
||||
210 GOSUB 1270
|
||||
220 PRINT
|
||||
230 LET X=INT(6*RND(1)+1)
|
||||
240 LET Y=INT(6*RND(1)+1)
|
||||
@@ -118,7 +118,7 @@
|
||||
1240 GOTO 450
|
||||
1250 PRINT" CHERRY"
|
||||
1260 GOTO 450
|
||||
1270 FOR Q4=1 TO 10
|
||||
1270 FOR Q4=1 TO 10
|
||||
1280 PRINT CHR$(7);
|
||||
1290 NEXT Q4
|
||||
1300 RETURN
|
||||
|
||||
Reference in New Issue
Block a user