mirror of
https://github.com/gregory-jagermeister/Fantasy-Content-Generator.git
synced 2026-07-22 07:30:31 +00:00
17 lines
No EOL
593 B
TypeScript
17 lines
No EOL
593 B
TypeScript
import { drinkGeneratorSettings } from "main";
|
|
|
|
export function generatorDrinks(settings: drinkGeneratorSettings) {
|
|
const adjectives = settings.adj;
|
|
const nouns = settings.nouns;
|
|
|
|
let adjectivetotal = "";
|
|
const numAdjectives = Math.random() < 0.5 ? 1 : 2;
|
|
for (let i = 0; i < numAdjectives; i++) {
|
|
const randomAdjective = adjectives[Math.floor(Math.random() * adjectives.length)];
|
|
adjectivetotal += randomAdjective + " ";
|
|
}
|
|
const randomNoun = nouns[Math.floor(Math.random() * nouns.length)];
|
|
|
|
return `${adjectivetotal} ${randomNoun}`;
|
|
|
|
} |