
Weekend Creative Agent Challenge: Code3 — One Coding Puzzle. Three Attempts. Every Day.
Code3 is a weekend MVP for the AWS Set Your Creative App Free Weekend Challenge. An autonomous AWS agent creates a new Python puzzle every day, checks recent puzzles to avoid repetition, and adapts tomorrow's difficulty from the previous day's anonymous solve/fail rate.
Weekend Creative Agent Challenge: Code3 — One Coding Puzzle. Three Attempts. Every Day.
#agents
Vision
Code3 is a daily programming game built around a simple idea:
One coding puzzle. Three attempts. Every day.
Instead of asking players to write an entire program from scratch, Code3 provides most of the solution and removes one important piece of logic.
The missing part can be a condition, arithmetic expression, loop, function body, or an important algorithm step.
For example, a player might receive most of a binary-search implementation but need to complete the two lines required to find the first occurrence of a value.
This makes each challenge short enough to play in a few minutes while still requiring real programming reasoning.
The player gets three attempts. A wrong answer, syntax error, or runtime error consumes one attempt.
But the daily puzzle itself is only half of the project.
The main goal of this challenge was to create an autonomous agent that prepares the next experience before the user returns.
That is where AWS comes in.
⸻
The Autonomous Agent
Every day, Code3 automatically generates a new programming puzzle without requiring a developer to create it manually.
The generation flow is:
Amazon EventBridge Scheduler
↓
AWS Lambda
↓
Read previous puzzle statistics
↓
Determine difficulty
↓
Read recent puzzle history
↓
Amazon Bedrock / Amazon Nova
↓
Generate a new puzzle
↓
Validate the generated solution
↓
Store and publish the challenge
The agent does more than generate random exercises.
It looks at how the community performed on the previous challenge and uses that information to influence the next one.
The current adaptive difficulty rules are intentionally simple:
- If fewer than 5 players completed the challenge, the difficulty remains unchanged.
- If more than 65% of players failed, the next challenge becomes easier.
- If fewer than 25% failed, the next challenge becomes harder.
- Otherwise, the difficulty stays at the same level.
Code3 currently uses three difficulty levels:
Easy → Medium → Hard
The agent also considers recent puzzles so that it does not repeatedly generate the same type of challenge.
For example, if recent challenges focused heavily on loops, the next generation can be directed toward a condition or algorithm step instead.
This means the agent is not only generating new content every day. It is gradually adjusting what it creates based on how people interact with the game.
⸻
Puzzle Generation
The MVP focuses exclusively on Python.
A puzzle contains most of an existing solution, while the player fills only the meaningful missing section.
The missing fragment can be between one and several lines.
Example:
def first_duplicate(numbers):
seen = set()
# YOUR CODE HERE
return -1
Expected behavior:
[1, 4, 2, 4] → 4
[3, 1, 2, 3] → 3
[1, 2, 3] → -1
A valid solution might be:
for n in numbers:
if n in seen:
return n
seen.add(n)
This format keeps the experience closer to a small competitive-programming puzzle than a traditional coding tutorial.
The challenge is not simply remembering Python syntax. The player must understand the existing code and identify which logical piece is missing.
⸻
Validating AI-Generated Puzzles
One of the most important engineering decisions was not trusting generated content automatically.
Amazon Nova generates the puzzle structure, examples, tests, and official solution, but the backend validates the generated output before publishing it.
The generation process follows a pattern similar to:
Generate
↓
Validate structure
↓
Validate allowed Python
↓
Run official solution against tests
↓
Valid?
↙ ↘
No Yes
↓ ↓
Retry Publish
If a generated challenge is invalid, the agent can retry generation.
The MVP also includes a deterministic fallback so that a generation failure does not leave the application without a daily puzzle.
This was an important lesson from the project: when generative AI becomes part of an automated production workflow, validation becomes just as important as generation.
⸻
Running Player Code
Players execute their missing Python fragment directly inside the browser using Pyodide, which runs Python through WebAssembly.
This was a deliberate architecture decision.
Executing arbitrary player code directly inside an AWS Lambda function would introduce unnecessary security risks and infrastructure complexity for a weekend MVP.
Instead:
Player browser
↓
Pyodide
↓
Execute completed function
↓
Run puzzle tests
↓
Return result
The backend only receives the final anonymous game result needed for aggregate statistics.
This keeps the AWS architecture small while still providing a real coding experience.
⸻
AWS Architecture
The project uses a serverless architecture.
Amazon Bedrock / Amazon Nova
Amazon Nova generates the daily programming challenge based on the requested difficulty, puzzle type, and recent history.
AWS Lambda
Lambda runs the autonomous puzzle-generation workflow and provides the lightweight backend API.
Amazon DynamoDB
DynamoDB stores puzzles and aggregate gameplay statistics used by the adaptive difficulty system.
Amazon EventBridge Scheduler
EventBridge automatically triggers the generator every day.
This is what turns Code3 from a normal AI-powered application into an always-on agent.
The user does not press a “Generate” button.
The next challenge is already waiting when they return.
AWS Amplify
The frontend can be deployed as a lightweight static web application using Amplify Hosting.
AWS SAM
The backend infrastructure is defined using AWS Serverless Application Model so that the application can be reproduced and deployed consistently.
⸻
Designing for a Weekend MVP
A major part of this project was deciding what not to build.
Code3 intentionally does not include:
- authentication,
- profiles,
- leaderboards,
- multiplayer,
- multiple programming languages,
- a large backend framework,
- dedicated code-execution servers.
The MVP focuses on proving one complete loop:
community plays
↓
results are collected
↓
agent learns from performance
↓
agent creates tomorrow's puzzle
↓
new challenge is automatically published
That loop is the core of the project.
⸻
What I Learned
The biggest lesson was that building an agent is different from simply adding an LLM call to an application.
The model itself is only one component.
A useful autonomous workflow also needs:
- scheduling,
- state,
- history,
- validation,
- failure handling,
- clear boundaries,
- and a way for previous results to influence future behavior.
I also learned how useful serverless architecture can be for small autonomous applications.
Lambda, EventBridge, DynamoDB, and Bedrock allow the agent to run without maintaining an always-on server.
Another important lesson was scope control.
It was tempting to add accounts, rankings, multiple languages, and more complex code execution. Keeping the MVP focused made it possible to spend more time on the agent itself and the daily gameplay loop.
⸻
What’s Next
One feature I would like to explore next is a monthly collectible system.
At the beginning of each month, an image-generation agent could create a secret pixel-art image.
Every daily puzzle solved would reveal one piece of that month’s artwork.
A 31-day month would therefore contain 31 revealable pieces.
This would connect the daily coding habit with a longer-term visual reward while keeping the core Code3 mechanic unchanged.
Other future improvements could include:
- more sophisticated difficulty adaptation,
- additional puzzle categories,
- personalized challenge progression,
- more programming languages,
- community statistics,
- and stronger isolated execution for larger code fragments.
For now, the goal remains simple:
come back tomorrow, solve one small programming puzzle, and see what the agent created for you.
Links
Live application:
GitHub repository:
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article