mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-07 19:02:37 -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:
@@ -47,7 +47,7 @@ namespace Number
|
||||
{
|
||||
Random rand = new Random();
|
||||
|
||||
// Get a unique set of random numbers between 1 and 5
|
||||
// Get a unique set of random numbers between 1 and 5
|
||||
// I assume this is what the original BASIC FNR(X)=INT(5*RND(1)+1) is doing
|
||||
Random1 = (int)(5 * rand.NextDouble() + 1);
|
||||
do
|
||||
@@ -77,10 +77,10 @@ namespace Number
|
||||
int Guess = 0;
|
||||
|
||||
GetRandomNumbers(out Random1, out Random2, out Random3, out Random4, out Random5);
|
||||
|
||||
|
||||
while (!Win)
|
||||
{
|
||||
|
||||
|
||||
Guess = PromptForGuess();
|
||||
|
||||
if (Guess == Random1)
|
||||
@@ -96,7 +96,7 @@ namespace Number
|
||||
Points += 1;
|
||||
else if (Guess == Random5)
|
||||
Points -= (int)(Points * 0.5);
|
||||
|
||||
|
||||
if (Points > 500)
|
||||
{
|
||||
Console.WriteLine("!!!!You Win!!!! with {0} points.", Points);
|
||||
@@ -123,4 +123,4 @@ namespace Number
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -35,5 +35,3 @@ sub FNR {
|
||||
my ($X)= @_; #Useless...
|
||||
return int(5*rand(1)+1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user