Practice agentic coding with the MATLAB One-Button Game Mini Hack
MATLAB Central's Mini Hack contests have evolved quite a bit over the years. Back in 2021 we asked competitors to produce a beautiful image using only 280 characters of MATLAB code. This format was so popular that we repeated it in 2022. In 2023, the character count was increased to 2,000 with the aim to produce a 2 second, 48 frame animated looping gif. In 2024 we kept the 2,000 character count but the video-length was increased to 12 seconds; one of the winning entries from that year is shown below.
MATLAB One-Button Game Mini Hack
Part of the fun of all of the previous competitions was dealing with the limitations. Indeed, while researching this article I discovered the concept of creative limitation and the quotation by artist Phil Hansen who said in his TED Talk "Embracing the limitation can actually drive creativity … We need to first be limited in order to become limitless"
The primary limitation in this year's competition is that you can only use one button; either a mouse click or the space-bar to control your game. It turns out that such 'one-button games' form an entire genre which go back at least a couple of decades so this isn't quite as limiting as you might originally think.
Secondary limitations are that your code must be 10,000 characters or less and that you should use MATLAB R2022b or above but in my experience so far, they are nothing to worry about.
The competition started a few days ago and there are already a bunch of fun entries which you can play in the gallery.
As a MathWorks employee, I am ineligible for any prizes and so feel no shame at all in promoting one of my entries, Slalom Run. Here's a video of me playing it. The space bar changes the skier's direction
Using the Mini Hack to sharpen your agentic coding skills
While you are absolutely free to hand-code your entries if you wish; we actively encourage you to use this as an opportunity to practice your agentic coding skills. I already had the MATLAB Agentic Toolkit installed and so was up and running in minutes.
I downloaded and unzipped the MATLAB One-Button Game Mini Hack Starter Project, pointed my agent to it instructed the AI to 'Read AGENTS.md and help me build a skiing game'. That was enough to get started but getting a fun, playable game took rather more effort.
The AGENTS.md file is part of the not-so-secret sauce that makes all of this work so well and is essentially an agent skill that teaches your AI everything it (and you) needs to know in order to participate in the competition. It will even help you install required tools such as the MATLAB Agentic Toolkit if you don't already have it. It also includes the form that the game must take, advice to the agent on how to test it, banned functions and operators and so on.
For more detailed instructions on how to get started using AI agents for the contest, read this article by MathWorker David Wey that even discusses how to set up local AI agents!
The role of the human in the loop
My advice to anyone who is embarking on their first steps with agentic coding is to start with low stakes situations. Learn the strengths and weaknesses of the tools in a domain that you understand but where it doesn't really matter if things go wrong.
This competition is perfect for that! The only lives that can be lost are virtual and the worst possible outcome is someone telling you that your game is rubbish.
In his excellent YouTube video, 6 Engineering Skills That AI Won't Replace, Brian Douglas discusses skills a good engineer needs in a world where the code is written by AI and I think that many of them apply to this competition.
With a frontier AI model, you can produce a reasonable looking game in one short prompt. All the code will be there, it will run, it might even be fun! However, a great game will usually take more time. You need skills like problem framing, understanding constraints, systems thinking and modeling judgment; just as 'proper' engineering and science requires.
One thing that I noticed is that the AI I used wasn't very good at coming up with something that was fun. With both of the games that I produced so far, I needed to do a lot of playing and tweaking before I felt that I had a game I'd want to spend some time with.
Coming up with an original game is even harder. Indeed, after looking at my first game Orbit Hopper, Vinay correctly guessed which agent I used to create it since it seems that particular agent loves variations of this game!
Playing and publishing your games
While you are developing your own game, you can run it in MATLAB with the command
which comes from the MATLAB One-Button Game Mini Hack Contest Toolkit that's installed by the Starter project.
To submit your current game to File Exchange you run the command
As long as you are logged into your MathWorks account in your default web browser, this will publish your game directly to the contest gallery.
Playing other people's games
Click on a game you like the look of in the contest gallery. For example here is an entry from Vinay Ramesh, the developer behind most of the contest's infrastructure.
Click on the gif and you'll be taken to that entry's page where you'll see the Play Game button.
Click on that, and you'll be taken to where the game lives in MATLAB Drive where you'll find a Run this App button which will allow you to play the game itself in MATLAB online.
You can also click on 'Add to my Files' which will copy the game to your own MATLAB Drive. If you have MATLAB Connector installed, this will sync with your Desktop MATLAB Drive and you'll then be able to run it in your Desktop MATLAB.
Reading tips from other people (and contributing your own)
The competition encourages people to share tips about how they developed their game in the MATLAB Discussions Tips and Tricks forum. Indeed, you need to have written a tricks and tips post in order to be eligible for any of the prizes.
So far, we are less than a day into the competition and we already have a couple of excellent posts:
- How Mohammad Aryayi made his 70,000 character game fit into 10,000 characters
- How Jan Studnicka used Claude to create his game, Club Knight
Remember, you need to make a Tips and Tricks post to be eligible for a prize!
Over to you
Go play some games and vote for your favorites, read the contest rules which includes prizes, set up your agentic AI environment, build a game, submit to the gallery and then tell us about your experiences in the Tips and Tricks forum.
This contest runs for 4 weeks. It begins on November 2nd, 2026 at 00:00:00 am EST and ends on November 29th, 2026 at 11:59:59 pm EST.
Have fun!





评论
要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。