cowherdafhenerator

2.1.2 • Public • Published

Cow Herd Generator

Description

This is a simple JavaScript script that generates a herd of cows and a flock of chickens. It randomly assigns names, colors, and ages to each animal and then describes them.

Cow Generation

The script generates a herd of cows by randomly selecting names, colors, and ages from predefined lists. Each cow is then instantiated with these attributes and added to the herd.

Chicken Generation

Similarly, the script also generates a flock of chickens using predefined lists of names, colors, and ages. Each chicken is instantiated with these attributes and added to the flock.

Running the Script

To run the script, simply execute the main function. This will generate the cow herd and chicken flock and display their descriptions in the console.

Example Output

Cow Herd

  • A black cow, 8 years old, named Bessie.
  • A brown cow, 6 years old, named Spot.
  • A white cow, 10 years old, named Daisy.

Chicken Flock

  • A white chicken, 12 months old, named Penny.
  • A brown chicken, 8 months old, named Nugget.
  • A black chicken, 18 months old, named Cluck Cluck.

Additional Notes

This script is for demonstration purposes and can be customized further as needed.

Package Sidebar

Install

npm i cowherdafhenerator

Weekly Downloads

1

Version

2.1.2

License

Apache-2.0

Unpacked Size

4.56 kB

Total Files

3

Last publish

Collaborators

  • dani1711