AWS Logo
Menu
Relive the Innings: Mini Cricket Game Built Effortlessly with Amazon Q CLI

Relive the Innings: Mini Cricket Game Built Effortlessly with Amazon Q CLI

We all grew up playing cricket in the streets or parks, swinging bats and chasing balls with friends. I decided to rebuild that nostalgic mini cricket experience using Amazon Q CLI in just one prompt.

Published May 23, 2025
Introduction
Cricket was a big part of my childhood—playing in the streets, making stumps out of bricks, and dreaming of hitting sixes like the pros.
To relive those memories, I built a mini cricket game using Amazon Q CLI—and the best part?
I did it with just 1 prompt.
Let’s bring back those cricket vibes—one line at a time!

Installation and Setup:

I Refer these two blogs for my installation and Amazon Q CLI Setup.

Prompt I used with Q CLI:

Create a complete Mini Cricket Game in Python using the `tkinter` library. The game should include the following features:
  1. The player bats by clicking a number (1 to 6) using buttons.
  2. The computer (AI) randomly generates a number (1 to 6) for bowling.
  3. If the player's number matches the AI's number, the player is **out**.
  4. If the numbers don’t match, the player scores runs equal to their selected number.
  5. The score should be displayed in real-time.
  6. After the player is out, display a **Game Over** message with the final score and a **Play Again** button.
  7. Use clean, modular code with comments to explain each section.
  8. The GUI should include:
  • A title ("Mini Cricket Game")
  • 6 buttons for batting input (1 to 6)
  • Labels showing:
 - Player’s run
- AI's bowl
 - Total Score
 - Game status (e.g., "You’re Out!" or "Good Shot!")
  •  A restart button that resets the game when clicked.
Within seconds, I had all the essentials:
  • A solid foundation with a structured game loop
  • Smooth and responsive player controls
  • Collision logic that just works
  • Real-time score tracking and updates
  • Clean, modular code — easy to read and fully commented
Developer Insight:
Think Q CLI is only for writing code? Think again. It also helps you debug, optimize, and understand your code — all in one prompt.

Output Code:

Game Playing Drive Link:
https://drive.google.com/file/d/1BwnAMY78YMODo5CVmJpOhXDy1sx7o_ql/view?usp=drive_link
Clear Explanation About The Game that is Given By Amazon Q CLI
when play there itself in Amazon Q CLI it will install all the dependencies.
Documentation
The documentation that is given by Amazon Q CLI
Learnings from This:
This project taught me:
1. Crafting the Perfect Game Loop - Creating that "just one more try" feeling that keeps players engaged through balanced difficulty and instant feedback
2. UI Psychology in Action - Using color psychology and visual design to enhance player experience and create emotional connections to the game
3. Elegant Problem-Solving - Transforming a complex childhood game into clean, modular code that's both efficient and maintainable

Want to Try It Yourself?

Download the code, run it, and modify it. Add music, levels, obstacles — make it your own!

Comments