mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-08 03:12:26 -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:
@@ -5,7 +5,7 @@
|
||||
static void Main(string[] args)
|
||||
{
|
||||
PrintIntro();
|
||||
|
||||
|
||||
string keepPlaying = "Y";
|
||||
|
||||
while (keepPlaying == "Y") {
|
||||
@@ -43,7 +43,7 @@
|
||||
Console.WriteLine($"TOTAL ROUNDS EXPENDED WERE:{totalAttempts}");
|
||||
|
||||
if (amountOfGames < 4) {
|
||||
Console.WriteLine("THE FORWARD OBSERVER HAS SIGHTED MORE ENEMY ACTIVITY...");
|
||||
Console.WriteLine("THE FORWARD OBSERVER HAS SIGHTED MORE ENEMY ACTIVITY...");
|
||||
} else {
|
||||
if (totalAttempts > 18) {
|
||||
PrintReturnToBase();
|
||||
@@ -111,7 +111,7 @@
|
||||
return elevation;
|
||||
}
|
||||
|
||||
static void PrintIntro()
|
||||
static void PrintIntro()
|
||||
{
|
||||
Console.WriteLine(new String(' ', 30) + "GUNNER");
|
||||
Console.WriteLine(new String(' ', 15) + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" + Environment.NewLine + Environment.NewLine + Environment.NewLine);
|
||||
|
||||
@@ -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");
|
||||
@@ -67,7 +67,7 @@ async function main()
|
||||
s = 0;
|
||||
print("DISTANCE TO THE TARGET IS " + t + " YARDS.\n");
|
||||
print("\n");
|
||||
|
||||
|
||||
while (1) {
|
||||
print("\n");
|
||||
print("ELEVATION");
|
||||
|
||||
@@ -15,7 +15,7 @@ def gunner():
|
||||
S1 = 0
|
||||
|
||||
while True:
|
||||
T = int(R * (.1 + .8 * random()))
|
||||
T = int(R * (0.1 + 0.8 * random()))
|
||||
S = 0
|
||||
|
||||
print("\nDISTANCE TO THE TARGET IS", T, "YARDS.")
|
||||
@@ -39,8 +39,10 @@ def gunner():
|
||||
X = T - I
|
||||
E = int(X)
|
||||
|
||||
if (abs(E) < 100):
|
||||
print("*** TARGET DESTROYED *** ", S, "ROUNDS OF AMMUNITION EXPENDED.")
|
||||
if abs(E) < 100:
|
||||
print(
|
||||
"*** TARGET DESTROYED *** ", S, "ROUNDS OF AMMUNITION EXPENDED."
|
||||
)
|
||||
S1 += S
|
||||
if Z == 4:
|
||||
print("\n\nTOTAL ROUNDS EXPENDED WERE: ", S1)
|
||||
@@ -52,7 +54,9 @@ def gunner():
|
||||
return
|
||||
else:
|
||||
Z += 1
|
||||
print("\nTHE FORWARD OBSERVER HAS SIGHTED MORE ENEMY ACTIVITY...")
|
||||
print(
|
||||
"\nTHE FORWARD OBSERVER HAS SIGHTED MORE ENEMY ACTIVITY..."
|
||||
)
|
||||
break
|
||||
else:
|
||||
if E > 100:
|
||||
@@ -80,6 +84,6 @@ if __name__ == "__main__":
|
||||
gunner()
|
||||
|
||||
Y = input("TRY AGAIN (Y OR N)? ")
|
||||
if (Y != "Y"):
|
||||
if Y != "Y":
|
||||
print("\nOK. RETURN TO BASE CAMP.")
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user