mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-09 11:46:24 -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:
@@ -79,7 +79,7 @@ namespace trap_cs
|
||||
}
|
||||
}
|
||||
static void Print(string stringToPrint)
|
||||
{
|
||||
{
|
||||
Console.WriteLine(stringToPrint);
|
||||
}
|
||||
static void Print()
|
||||
|
||||
@@ -198,4 +198,4 @@ public class Trap {
|
||||
return (int) (Math.random()
|
||||
* (HIGH_NUMBER_RANGE) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -56,7 +56,5 @@ while (1) {
|
||||
print "TRY AGAIN.\n";
|
||||
print "\n";
|
||||
}
|
||||
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
@@ -20,8 +20,10 @@ def play_game():
|
||||
user_guess = [-1, -1]
|
||||
while user_guess == [-1, -1]:
|
||||
try:
|
||||
user_input = [int(item) for item in input(
|
||||
"\nGuess # " + str(turn) + " ? ").split(",")]
|
||||
user_input = [
|
||||
int(item)
|
||||
for item in input("\nGuess # " + str(turn) + " ? ").split(",")
|
||||
]
|
||||
if len(user_input) == 2:
|
||||
if sum(1 < x < number_max for x in user_input) == 2:
|
||||
user_guess = user_input
|
||||
@@ -65,8 +67,7 @@ def main():
|
||||
keep_playing = True
|
||||
while keep_playing:
|
||||
play_game()
|
||||
keep_playing = input(
|
||||
"\nTry again. ").lower().startswith("y")
|
||||
keep_playing = input("\nTry again. ").lower().startswith("y")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
170 PRINT "YOU GET";G;"GUESSES TO GET MY NUMBER."
|
||||
180 X=INT(N*RND(1))+1
|
||||
190 FOR Q=1 TO G
|
||||
200 PRINT
|
||||
200 PRINT
|
||||
210 PRINT "GUESS #";Q;
|
||||
220 INPUT A,B
|
||||
230 IF A=B AND X=A THEN 400
|
||||
@@ -40,9 +40,9 @@
|
||||
360 R=A
|
||||
370 A=B
|
||||
380 B=R
|
||||
390 RETURN
|
||||
390 RETURN
|
||||
400 PRINT "YOU GOT IT!!!"
|
||||
410 PRINT
|
||||
410 PRINT
|
||||
420 PRINT "TRY AGAIN."
|
||||
430 PRINT
|
||||
440 GOTO 180
|
||||
|
||||
Reference in New Issue
Block a user