Simulating the Siglo Game in Python

Simulating the Siglo Game in Python

Source: Dev.to

🎯 Simulating the Siglo Game in Python: A Beginner’s Journey into Game Logic 🧠 Why I Built This
As a computer science student learning Python, I wanted to create something fun, culturally meaningful, and educational. I played Siglo in my teen years, a traditional Colombian tile-drawing game where players aim to reach 100 points without going over. It’s simple, strategic, and perfect for learning how to build interactive programs using Python classes, loops, and conditionals. 🖼️ What It Looks Like
Here’s a snapshot of my program in action: In this round, Juan drew tiles totaling 121 and went bust, while Jose played it safe and won with 93 points! 🧾 How the Code Works
The program is built around two classes: Player and SigloGame. Each player draws tiles from a shuffled bag (numbers 1–90), and a special “wild tile” (called vira) is added to everyone’s score. Players decide whether to draw again or stay. If their total exceeds 100, they bust. The game ends by declaring the player closest to 100 as the winner.
Here’s a quick breakdown:
• Player class tracks each player’s name, tiles, and score.
• SigloGame handles the game setup, player registration, tile drawing, and winner logic.
• The game runs interactively in the terminal using input() prompts.
You can explore the full code on GitHub: đź”— View siglo.py on GitHub âś… What I Learned
Building Siglo taught me how to:
• Use object-oriented programming to model real-world games.
• Handle user input and control flow with loops and conditionals.
• Simulate randomness with Python’s random module.
• Think about edge cases like busting or ties.
Thanks for reading! Whether you're learning Python or just love games, I hope this inspires you to build something playful and personal. Let me know if you try it out or want to improve it with AI strategies or GUI features. 🤖 Content generated with the help of Microsoft Copilot This blog post was created in collaboration with Copilot, an AI companion by Microsoft that assists with writing, coding, and creative tasks. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse