-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #941 from AmbientRun/misc-fixes
Misc fixes
- Loading branch information
Showing
18 changed files
with
185 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod game_view; | ||
pub mod player; | ||
pub mod util; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
use rand::seq::SliceRandom; | ||
|
||
/// Generates an adjective-animal username. | ||
pub fn random_username() -> String { | ||
const ADJECTIVES: &[&str] = &[ | ||
"Quirky", | ||
"Sneaky", | ||
"Witty", | ||
"Curious", | ||
"Grumpy", | ||
"Silly", | ||
"Mischievous", | ||
"Goofy", | ||
"Hasty", | ||
"Awkward", | ||
"Zany", | ||
"Peculiar", | ||
"Whimsical", | ||
"Bumbling", | ||
"Absurd", | ||
"Oddball", | ||
"Clumsy", | ||
"Nutty", | ||
"Haphazard", | ||
"Eccentric", | ||
]; | ||
|
||
const ANIMALS: &[&str] = &[ | ||
"Penguin", | ||
"Platypus", | ||
"Lemur", | ||
"Armadillo", | ||
"Sloth", | ||
"Ostrich", | ||
"Tapir", | ||
"Narwhal", | ||
"Chameleon", | ||
"Aardvark", | ||
"Quokka", | ||
"Wombat", | ||
"Kakapo", | ||
"Capybara", | ||
"Mandrill", | ||
"Axolotl", | ||
"Blobfish", | ||
"Echidna", | ||
"Wallaby", | ||
]; | ||
|
||
let mut rng = rand::thread_rng(); | ||
format!( | ||
"{}{}", | ||
ADJECTIVES.choose(&mut rng).unwrap(), | ||
ANIMALS.choose(&mut rng).unwrap() | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.