GitHub repository for this project
Author LinkedIn
As our Nile cruise drifted between Aswan and Luxor, the sun dipping low over the river’s shimmering surface, my travel companion unveiled a curious distraction: Beggar My Neighbour, a card game for two that hinges entirely on chance. The aim? To claim every card through a simple yet surprisingly gripping pay process. Our games stretched on, each round a test of patience as much as luck. This sparked a question in my mind—could the Python skills I’d honed at university unlock deeper insights into this game? What could we learn about its mechanics, and just how long might we expect these marathon matches to last?
Beyond unraveling the game’s mysteries, I set myself a second mission: to keep my coding and data science skills sharp while experimenting with a new AI tool to guide the process. Having previously leaned on ChatGPT’s 3rd and 4th generation models, I decided to switch things up for this project, enlisting xAI’s Grok 3 as my coding companion. Its fresh perspective promised to add an intriguing layer to this analytical adventure.
By its very design, Beggar My Neighbour leaves no room for skill—every game’s outcome is preordained by the shuffle of the deck. This meant my focus had to shift from predicting wins to dissecting the game’s inevitable flow. I set out to explore the number of moves and time it takes for a game to reach its conclusion, alongside tracking the frequency of dramatic comebacks and shifts in the lead. To wrap things up, I’d dive into the game’s edge cases—those rare outliers that defy the norm—before reflecting on my experience with Grok 3 and its role in bringing this project to life.
History