AWS Logo
Menu
Trap a cat šŸˆ A web game bring me back to 2008

Trap a cat šŸˆ A web game bring me back to 2008

Trying to demo my first web game, trap a cat comes to my mind out of the blue. It was one of my favorite casual games. I love cat, I love how randomly they move, like the gameā€™s main idea.

Published Nov 14, 2024
Trying to demo my first web game, trap a cat comes to my mind out of the blue. The game logic is simple, so I start by asking Q to build a structure.
With a simple prompt of Trap the cat, Q is super smart to figure out the basic game logic.
  • The game is played on an n*n grid
  • The cat starts in the center
  • Players can click cells to block them
  • The cat moves randomly among available adjacent cells
  • The goal is to trap the cat before it reaches the edge of the grid
It even prompt me with suggestions to improve the gameplay.
suggestions of next step
I picked 3, and the game is updated with a score system! Simple but makes it more complete.
Score System & Move Counter
As you can see in this screenshot, the cat has been trapped in the black walls, but the game doesnā€™t end because itā€™s not fully trapped in one cell - 0 possible move. I donā€™t want my cat being that miserable in one cell. I want to give it more free space! So I ask Q to redefine the winning condition and show the winning message at the webpage.
Old winning condition
Instead of checking possible move counts, Q prompt me with a new way to check if the cat is trapped - Checking if the cat can reach the border using a flood-fill approach! Smart!
Now my cat can breathe in the closed area. Thank god!
Finally, I want the interface to be prettier. Can Q help me with that??
Yes! Look that decent purple gray blur. Itā€™s just amazingly modern. I hold my breath when my cat is trapped in this small purple world, safe and sound.Ā 
Prettier version!
Q really helps me to build this cute little web game in just 30 mins. I am surprised how it could handle my random requests in a clever and thoughtful way. Not only it helps me to solve the problem, but also prompts me with more additional ideas to keep boosting my creativity.
Even just for such a simple childhood game. It brings me back to 8 years old, a purple dream with an orange little cat. Now I do have my own real cat, cuddling it in my arms - it was like a little trap. When I use a towel to wrap him up to cut his nails, another trap. hahaĀ 
Hope you all have fun digging back to childhood a bit. Q will help your vintage dream come true.
Ā 
My cat Mocha

Ā 

Comments