SkillAgentSearch skills...

Namegen

javascript Name Generator (or advanced string concatenator)

Install / Use

/learn @jimdoescode/Namegen
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

This is an advanced string concatenator. It is geared towards creating random names but can be used to create any random string given the correct setup.

To setup a name generator you need to create a javascript object which you then pass into the name generator upon execution.

The object should look as follows:

var nameObj = {
	//Declare some casts
	male: {
		//Declare parts of string
		start: ['Aer', 'An', 'Ar'],
		middle: ['al', 'an', 'ian'],
		end: ['an', 'ath', 'is', 'or'],
		title: ['The Brave'],
		//(optional) Declare illegal combos
		illegal: ['ananan'],
		//Declare a rule that puts the parts together
		//Dollar sign '$' separates each command.
		//A number specifies the chance the next part will appear.
		//An underscore '_'  represents a space.
		rule: '$start$50$middle$end$_$10$title'
	},
	female: {
		start: ['Aer', 'An', 'Ar'],
		middle: ['al', 'en', 'ess'],
		end: ['aella', 'ia', 'wen', 'wyn'],
		title: ['Lady'],
		rule: '$10$title$_$start$50$middle$end'
	}
}

Now when you create the name generator you would pass in the name object like this:

var gen = new NameGen(nameObj);

Then to get a name you would specify a cast that is in the nameObj like this:

var name = gen.getName('female');

That will return a random combination of the string segments you created in the name object.

Related Skills

View on GitHub
GitHub Stars15
CategoryDevelopment
Updated2y ago
Forks0

Languages

JavaScript

Security Score

60/100

Audited on Feb 8, 2024

No findings