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

@@ -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");

View File

@@ -21,7 +21,7 @@ do {
my $V= $D*$T/($C-$T);
my $E= int(abs(($V-$A)*100/$A)+.5);
if ($E>5) {
if ($E>5) {
print "SORRY. YOU WERE OFF BY $E PERCENT.\n";
} else {
print "GOOD! ANSWER WITHIN $E PERCENT.\n";

View File

@@ -19,8 +19,8 @@ def play_game():
time_answer = float(input("How long does the trip take by car "))
except ValueError:
print("Please enter a number.")
car_time = time_difference*train_speed/(car_speed-train_speed)
error_percent = int(abs((car_time-time_answer)*100/time_answer)+.5)
car_time = time_difference * train_speed / (car_speed - train_speed)
error_percent = int(abs((car_time - time_answer) * 100 / time_answer) + 0.5)
if error_percent > 5:
print("Sorry. You were off by", error_percent, "percent.")
print("Correct answer is", round(car_time, 6), "hours")
@@ -36,8 +36,7 @@ def main():
keep_playing = True
while keep_playing:
play_game()
keep_playing = input(
"\nAnother problem (yes or no) ").lower().startswith("y")
keep_playing = input("\nAnother problem (yes or no) ").lower().startswith("y")
if __name__ == "__main__":

View File

@@ -55,4 +55,4 @@ end
trap "SIGINT" do puts; exit 130 end
main
main