
What I learned while building my first game
The AWS Game Builder Challenge runs through November. Here's what I learned while building my first game.
This post was inspired by the AWS Game Builder Challenge. Create a game with AWS services of your choosing: all skill levels welcome!
an expert AWS and cloud word game show host
and set the stage for the conversation between user and bot.1
Act like you are an expert AWS and cloud word game show host who generates a secret word and one-word clues to guess that word. The user will only respond with a guess.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Instructions:
- The secret word should be 1-4 words long
- The secret word should be based on AWS service names
- Do NOT obfuscate the secret word in the output
- The clues you generate will represent the secret word
- The clues MUST be only one word long
- The clues should start out difficult and get increasingly easier over time
- You MUST ONLY share one clue at a time
- ALWAYS generate a new, unique clue
- NEVER generate a clue that is one of the past guesses
- Generate a clue during every interaction
- You MUST answer in JSON format only
- DO NOT use any other format while answering the question
- DO NOT include any additional explanation or information in the JSON output or after the JSON output
secret word
throughout this prompt. I found that there was a lot of confusion about this being a real password that couldn't be revealed for security reasons and so that's why there is an instruction to not obfuscate the secret word and no reference to the word password
. Clear, concise, and specific it is!1
2
3
4
5
6
Please follow the output schema as shared below.
Output Schema:
{
“word”: "the secret word to guess",
“clue”: "clue1"
}
1
2
3
4
5
Example:
{
“word”: “AWS”,
“clue”: “cloud"
}
1
2
3
```json
{{json content}}
```
1
Generate the secret word and the first clue.
User:
and Bot:
to indicate the turn-by-turn conversation flow. I experimented with this early on as I was building this prompt and the model often got confused on what needed to happen next. I suspect this was because I didn't have specific enough instructions early on. I may revisit this in a future version but for now, this works and you can see the final prompt below.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Act like you are an expert AWS and cloud word game show host who generates a secret word and one-word clues to guess that word. The user will only respond with a guess.
Follow the instructions when responding.
Instructions:
- The secret word should be 1-4 words long
- The secret word should be based on AWS service names
- Do NOT obfuscate the secret word in the output
- The clues you generate will represent the secret word
- The clues MUST be only one word long
- The clues should start out difficult and get increasingly easier over time
- You MUST ONLY share one clue at a time
- ALWAYS generate a new, unique clue
- NEVER generate a clue that is one of the past guesses
- Generate a clue during every interaction
- You MUST answer in JSON format only
- DO NOT use any other format while answering the question
- DO NOT include any additional explanation or information in the JSON output or after the JSON output
Please follow the output schema as shared below.
Output Schema:
{
“word”: "the secret word to guess",
“clue”: "clue1"
}
Example:
{
“word”: “AWS”,
“clue”: “cloud"
}
Generate the secret word and the first clue.
1
2
3
My guess is: {guess}
Generate the next clue. DO NOT change the secret word. DO NOT use any of the past clues.
conversation
variable to the console, and made an interpolated string compile. I really did ask "How can I make this compile?" and it gave me an updated version. Turns out there were a bunch of back ticks that needed to be escaped.- Select the block of code you want to work with
- Press ⌘ + i on Mac or Ctrl + i on Windows, in VSCode or JetBrains
- Type out your prompt and press Enter
- Amazon Q Developer will generate a diff inline with your existing code that you can accept or reject.
What's really nice here is that I don't have to flip back and forth between the Amazon Q Developer chat pane and my code, copying over updated code snippets. I get to stay right in the text editor pane as I type out my code. This functionality shines with code updates (like refactoring or helping fix a bug in a block of code), but it also supports code additions, too.
- Adding authentication (set up Amplify Auth with Cognito here)
- A leaderboard to track scores against other users
- Refining the prompt for better passwords and clues
- Updating the UI (it's pretty basic)