Thoughts Brewing Blog

Playing a game a cards with a Chatbot

Written by Damien Griffin | Jul 3, 2024 1:30:00 PM

I mentioned in a previous AI Quick Tip post that I used meta-prompting to figure out how to play a game of gin rummy with Perplexity AI.  This post goes into the details.

 

What is a meta-prompt?

In case you didn’t read that post, a meta-prompt is when you create a prompt that asks how to create a prompt.


It can be a useful tactic when you aren’t sure what will be effective to get you the results you are looking for.

Details of my gin rummy meta-prompt

experience

I didn’t know what would work or what wouldn’t so I asked - 

What would be an effective prompt to use that would allow me to play a game of gin rummy with you?


Here is the answer that I got back - 

To play a game of gin rummy with an AI assistant, you could use a prompt like this:

"Let's play a game of gin rummy. Please keep track of both hands, the deck, and the discard pile. Deal 10 cards to each of us to start. Describe my hand to me, but keep yours hidden. Then, draw the first card for me and ask what I'd like to do. We'll take turns, following standard gin rummy rules. Please manage the gameplay, keep score, and let me know when either of us goes gin or knocks. Are you ready to begin?"


This prompt:

Sets up the game structure
Asks the AI to manage the game state
Establishes that you'll be playing with standard rules
Requests that the AI deal the initial hands
Initiates the turn-based gameplay
Asks the AI to keep score and announce important events


After providing this prompt, the AI should be able to start the game and guide you through the turns, allowing for an interactive gin rummy experience.


Sounded good enough so I tried it.  I copied the prompt text, exactly as written, into a new prompt.  


Result - 

Pretty good.  


Let’s keep going.  


My follow-up prompt followed the instructions

I would like to draw from the deck


Result - 

Reasonable.  Let’s continue

I would like to discard the 9 of Clubs


Result - 

Ooooh!  First mistake.  


If they discarded then it would be the top card instead of the card that I discarded on my last turn.


Honestly I walked away at this point.  Mainly because my goal was to see if I could use meta-prompting to see how to play a card game with an AI chatbot.  I would say that it was a success.


If I wanted to play out a full game, I would go back to my game prompt and modify the part to “keep yours hidden” and add language about their discards going on top of my discards and announcing the value.  


Then play through again until there is another mistake or we complete a game.  If there is a mistake then add it to the prompt and try again.  Etc.

 

Why this matters

This whole back and forth exercise with Perplexity took a few minutes.  


If I can go from not knowing if I can play a card game with an AI chatbot to being in the middle of a game that quickly then what else could I do?


If we are willing to consider that we can do something with these tools but we just have to figure out how, a lot of new opportunities become available.


The fact that we can ask some of the tools how we can best use them just makes things easier.


Start asking better questions