Making a Cat Name Generator - Part II

Making a Cat Name Generator - Part II

It's 2021 and little did I know I'd be spending my time making a cat name generator

Mike Eden's photo
Mike Eden
·Oct 8, 2021·

2 min read

On releasing v1.1––the internet was made for cats. I thought I was finished building Catcaller, but then it seemed like a good idea to add the possibility of filtering names based on sex. The list of names is just too long not to be split up into categories. Below is a snippet of my code.

cat-code.png

It's a tad bit long, isn't it? And there's three separate functions––one for each filter option. It's a lot of repeat code, and I'm sure I could've put it all into one function, but I was struggling to get it to work properly. But that's what refactoring is for, right?

Ideally, the user would be able to select multiple filters at one time. But this generator does not work like that. Instead, after the user selects one of the three parameters, the other two are grayed out and disabled until the user deselects the current parameter. I plan to change that in a following update. What if the user wants to generate both male and female names at once? Male and neutral? Female and neutral?

I may want to try making an empty array and then adding both male and female names to it using array.push(), or I could combine two lists using array.concat(). I'll save that for another day.

catcaller-demo1.gif

Future update ideas 💡

  • Add option to favorite names
  • Add option to combine names
  • Filter more than one parameter at a time
  • Additional names
  • UI changes

Support 🗣

Bugs can be reported to developer@cmdme.dev

GitHub repo size Link to the repo can be found here

Please reach out with any questions, comments or suggestions

 
Share this