128 lines
2.0 KiB
Rust
128 lines
2.0 KiB
Rust
use rand::prelude::*;
|
|
use rand::{thread_rng};
|
|
|
|
const FIRSTS: [&'static str; 50] = [
|
|
"artificial",
|
|
"ambient",
|
|
"borean",
|
|
"brewing",
|
|
"bristling",
|
|
"compressed",
|
|
"ceramic",
|
|
"chromatic",
|
|
"concave",
|
|
"convex",
|
|
"distorted",
|
|
"deserted",
|
|
"emotive",
|
|
"emotionless",
|
|
"elliptical",
|
|
"fierce",
|
|
"fossilised",
|
|
"frozen",
|
|
"gravitational",
|
|
"jovian",
|
|
"inverted",
|
|
"leafy",
|
|
"lurking",
|
|
"limitless",
|
|
"magnetic",
|
|
"metallic",
|
|
"mossy",
|
|
"mighty",
|
|
"modulated",
|
|
"nocturnal",
|
|
"noisy",
|
|
"nutritious",
|
|
"powerful",
|
|
"obscure",
|
|
"organic",
|
|
"oxygenated",
|
|
"oscillating",
|
|
"ossified",
|
|
"orbiting",
|
|
"piscine",
|
|
"purified",
|
|
"recalcitrant",
|
|
"rogue",
|
|
"subversive",
|
|
"subterranean",
|
|
"supercooled",
|
|
"subsonic",
|
|
"synthetic",
|
|
"terrestrial",
|
|
"weary",
|
|
];
|
|
|
|
const LASTS: [&'static str; 55] = [
|
|
"artifact",
|
|
"assembly",
|
|
"carbon",
|
|
"console",
|
|
"construct",
|
|
"craft",
|
|
"core",
|
|
"design",
|
|
"drone",
|
|
"distortion",
|
|
"detector",
|
|
"energy",
|
|
"entropy",
|
|
"exomorph",
|
|
"foilage",
|
|
"forest",
|
|
"form",
|
|
"fossil",
|
|
"frequency",
|
|
"function",
|
|
"information",
|
|
"insulator",
|
|
"layout",
|
|
"lifeform",
|
|
"landmass",
|
|
"lens",
|
|
"mantle",
|
|
"magnetism",
|
|
"mechanism",
|
|
"mountain",
|
|
"nectar",
|
|
"oak",
|
|
"oxide",
|
|
"orbit",
|
|
"pattern",
|
|
"plant",
|
|
"planet",
|
|
"poseidon",
|
|
"problem",
|
|
"receiver",
|
|
"replicant",
|
|
"river",
|
|
"satellite",
|
|
"scaffold",
|
|
"structure",
|
|
"shape",
|
|
"signal",
|
|
"synthesiser",
|
|
"system",
|
|
"tower",
|
|
"transmitter",
|
|
"traveller",
|
|
"vibration",
|
|
"warning",
|
|
"wildlife",
|
|
];
|
|
|
|
pub fn name() -> String {
|
|
let mut rng = thread_rng();
|
|
|
|
let first = rng.gen_range(0, FIRSTS.len() - 1);
|
|
let last = rng.gen_range(0, LASTS.len() - 1);
|
|
|
|
let mut s = String::new();
|
|
s.push_str(FIRSTS[first]);
|
|
s.push(' ');
|
|
s.push_str(LASTS[last]);
|
|
|
|
s
|
|
}
|