DEV Community

Cover image for Building a Stone Paper Scissors Game with Amazon Q CLI: A Step-by-Step Guide
adi-ray
adi-ray

Posted on

2 2 2 1

Building a Stone Paper Scissors Game with Amazon Q CLI: A Step-by-Step Guide

Overview

This blog walks you through the development of a Stone Paper Scissors game built using Amazon Q CLI, an AI-powered coding assistant that made development faster, smoother, and more enjoyable.

I chose this project because it's a fun and simple way to learn Python, explore clean code architecture, and test the power of Amazon Q CLI in an interactive development environment.

By the end of this blog, you'll learn:

  • How to install and configure Amazon Q CLI
  • How to iteratively build a Python game using AI-generated suggestions
  • How Amazon Q simplifies testing, debugging, and structuring code

Project Setup & Development

Setting Up Amazon Q CLI

Prerequisites

  • An AWS account
  • A working Python environment
  • WSL (for Windows users)

Installation Steps

For Windows Users (WSL Setup):

wsl -d Ubuntu
Enter fullscreen mode Exit fullscreen mode

💡 If you get WSL_E_DISTRO_NOT_FOUND, the below command will install Ubuntu distribution

wsl --install -d Ubuntu
Enter fullscreen mode Exit fullscreen mode

🔗 I referred to this guide for installing Amazon Q CLI on Windows

Start chatting with Amazon Q:

q chat
Enter fullscreen mode Exit fullscreen mode

Planning the Game

I first outlined the core requirements:

  • Player vs Computer gameplay
  • Score tracking
  • Replay option
  • Clean terminal UI with color support

Then, I structured the project with the following folders:

project-root/
│
├── src/
│   ├── game_engine.py
│   ├── utils.py
│   └── run_game.py
│
├── assets/
│   └── ascii_art.txt
Enter fullscreen mode Exit fullscreen mode

Building with Amazon Q CLI

Initial Prompt

I started by asking:

"Help me create a stone paper scissors game in Python with a clean architecture.
AI Prompt: Stone-Paper-Scissors with Pixel Art & 8-Bit Music

Target Library: PyGame (with Pyganim for pixel animations)

Style: Retro arcade vibe, dynamic AI, and special moves"

Amazon Q provided a basic structure with separate functions for input handling, logic, and scoring.

Iterative Development

I used follow-up prompts like:

  • "Add colorful terminal output to the game"
  • "Implement score tracking functionality"

Amazon Q responded with helpful suggestions using libraries like colorama and added features step-by-step, reducing manual effort.

Key Code Components

Some valuable code snippets from Q included:

  • A score dictionary to track wins
  • A function for randomized computer moves
  • A clean game loop with replay options

I refined variable names, added error handling, and tweaked color schemes for better UX.


Testing & Debugging with Amazon Q

Whenever I faced errors (like input mismatches or color issues), I simply asked:

"Fix this ValueError when input is invalid"

"Add unit tests for the game logic"

Amazon Q provided clear fixes and even mocked input() for testable functions.


Deployment

Running the Game

To play the game, simply run:

python src/run_game.py
Enter fullscreen mode Exit fullscreen mode

You'll see:

  • Colorful prompts
  • Real-time score updates
  • ASCII visuals (from assets/)

Screenshots

Gameplay Screenshot


Click the image above to watch the gameplay demo on YouTube


Lessons Learned

Pros of Using Amazon Q CLI

  • Super-fast prototyping
  • Clean, modular code generation
  • Helpful debugging prompts
  • Smart suggestions for best practices

Tips for Others

  • Break down tasks into short prompts
  • Use follow-ups to refine code
  • Always test generated code manually

Conclusion

This project demonstrated how Amazon Q CLI can accelerate even small projects like games while encouraging clean architecture and modular design.

If you’re learning Python or want to prototype apps efficiently, give Amazon Q CLI a try!


Resources

Heroku

Save time with this productivity hack.

See how Heroku MCP Server connects tools like Cursor to Heroku, so you can build, deploy, and manage apps—right from your editor.

Learn More

Top comments (5)

Collapse
 
nevodavid profile image
Nevo David

Pretty cool how you broke it down step by step- honestly, seeing tools like Amazon Q speed things up makes me wish I had this back when I started.

Collapse
 
adiray profile image
adi-ray

Thank you so much! I totally get what you mean- tools like Amazon Q has really changed the game. Honestly, this support feels like having a mentor on-call, especially when you're building something from scratch!

Collapse
 
dotallio profile image
Dotallio

Love how you emphasized modular code and interactive tweaks with Q - did Amazon Q change how you approached debugging or planning compared to coding without AI?

Collapse
 
adiray profile image
adi-ray

Absolutely! Using this AI assistant definitely shifted how I approached debugging. Instead of spending a lot of time researching smaller implementation details, I could focus more on designing the structure of the game and iteratively improving it.

Overall, it made the development feel more collaborative and allowed me to experiment more confidently. Thereby, making the process much faster.

Collapse
 
luxalgo profile image
LuxAlgo

Nice!

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Dive into this thoughtful piece, beloved in the supportive DEV Community. Coders of every background are invited to share and elevate our collective know-how.

A sincere "thank you" can brighten someone's day—leave your appreciation below!

On DEV, sharing knowledge smooths our journey and tightens our community bonds. Enjoyed this? A quick thank you to the author is hugely appreciated.

Okay