Learnings from Vibecoding #2

In Shoot the Serif game, i need to mix the fonts. Some are serif, some are sans serif.

At first, I tried to place each font manually. It was slow, boring, and I felt like a headless chicken.

Then I found Fisher-Yates shuffle.


Here's how it works:

Let's say you have a list of fonts:

Serif: Times New Roman, Georgia, Garamond Sans serif: Arial, Helvetica, Verdana

All together: Times New Roman, Georgia, Garamond, Arial, Helvetica, Verdana You don't want them in order. You want them mixed like cards!


🎲 Fisher-Yates Shuffle:

  1. Pretend the fonts are cards on a table
  2. Start from the last card
  3. Pick a random card from the ones still on the table (including the one you're at)
  4. Swap them
  5. Move to the next card back and repeat
  6. Keep going until the first card

Now every font can appear in any spot.


When to use it:

Whenever you want to mix things fairly and randomly:

  1. Fonts in a game
  2. Levels in a game
  3. Cards
  4. Quiz questions
  5. Anything you want shuffled

Wanna shoot serif fonts?