MAINT: Apply pre-commit

Remove byte-order-marker pre-commit check as there would be
many adjustments necessary
This commit is contained in:
Martin Thoma
2022-03-05 09:29:23 +01:00
parent f5e33ae38f
commit e64fb6795c
536 changed files with 6267 additions and 5556 deletions

View File

@@ -1,3 +1,3 @@
using Letter;
Game.Play();
Game.Play();

View File

@@ -139,4 +139,4 @@ public class Letter {
System.out.print(text);
return kbScanner.next();
}
}
}

View File

@@ -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");
@@ -61,7 +61,7 @@ async function main()
print("\n");
print("O.K., I HAVE A LETTER. START GUESSING.\n");
while (1) {
print("\n");
print("WHAT IS YOUR GUESS");
g++;

View File

@@ -14,6 +14,7 @@ import random
BELLS_ON_SUCCESS = False
def print_with_tab(space_count, msg):
if space_count > 0:
spaces = " " * space_count
@@ -22,6 +23,7 @@ def print_with_tab(space_count, msg):
print(spaces + msg)
def print_instructions():
print("LETTER GUESSING GAME")
print()
@@ -29,38 +31,40 @@ def print_instructions():
print("TRY TO GUESS MY LETTER AND I'LL GIVE YOU CLUES")
print("AS TO HOW CLOSE YOU'RE GETTING TO MY LETTER.")
def play_game():
target_value = random.randint(ord('A'), ord('Z'))
target_value = random.randint(ord("A"), ord("Z"))
num_guesses = 0
print()
print("O.K., I HAVE A LETTER. START GUESSING.")
print()
while True:
print("WHAT IS YOUR GUESS?")
num_guesses += 1
guess = ord(input())
print()
if guess == target_value:
print()
print(f"YOU GOT IT IN {num_guesses} GUESSES!!")
if num_guesses > 5:
print("BUT IT SHOULDN'T TAKE MORE THAN 5 GUESSES!")
# goto 515
print("GOOD JOB !!!!!")
if BELLS_ON_SUCCESS:
bellStr = chr(7) * 15
print(bellStr)
print()
print("LET'S PLAY AGAIN.....")
return
elif guess > target_value:
print("TOO HIGH. TRY A LOWER LETTER.")
continue
else:
print("TOO LOW. TRY A HIGHER LETTER.")
continue
print("WHAT IS YOUR GUESS?")
num_guesses += 1
guess = ord(input())
print()
if guess == target_value:
print()
print(f"YOU GOT IT IN {num_guesses} GUESSES!!")
if num_guesses > 5:
print("BUT IT SHOULDN'T TAKE MORE THAN 5 GUESSES!")
# goto 515
print("GOOD JOB !!!!!")
if BELLS_ON_SUCCESS:
bellStr = chr(7) * 15
print(bellStr)
print()
print("LET'S PLAY AGAIN.....")
return
elif guess > target_value:
print("TOO HIGH. TRY A LOWER LETTER.")
continue
else:
print("TOO LOW. TRY A HIGHER LETTER.")
continue
def main():
print_with_tab(33, "LETTER")
@@ -74,5 +78,6 @@ def main():
while True:
play_game()
if __name__ == "__main__":
main()