mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
After modifying indexes modulo isn't needed, it appears
This commit is contained in:
@@ -53,10 +53,9 @@ namespace Buzzword
|
||||
static string GeneratePhrase()
|
||||
{
|
||||
// Indexing from 0, so had to decrease generated numbers
|
||||
// modulo Phrases.Length added to not get out of bond
|
||||
return $"{Capitalize(Phrases[(int)(13 * rnd.NextDouble()) % Phrases.Length])} "
|
||||
+ $"{Phrases[(int)(13 * rnd.NextDouble() + 13) % Phrases.Length]} "
|
||||
+ $"{Phrases[(int)(13 * rnd.NextDouble() + 26) % Phrases.Length]}";
|
||||
return $"{Capitalize(Phrases[(int)(13 * rnd.NextDouble())])} "
|
||||
+ $"{Phrases[(int)(13 * rnd.NextDouble() + 13)]} "
|
||||
+ $"{Phrases[(int)(13 * rnd.NextDouble() + 26)]}";
|
||||
}
|
||||
|
||||
static bool Decision()
|
||||
|
||||
Reference in New Issue
Block a user