This AI tries to code whatever you tell it to, even videogames

robotic hand using laptop
(Image credit: Kilito Chan via Getty Images)

In the ever-increasing list of things that machine learning AI can do in our modern world, there's now a program that will code (or at least, try to code) whatever you tell it to in plain English. Want some flashy banner text that changes color every few seconds? Tell that to OpenAI Codex and it will code it for you in seconds.

The OpenAI Codex beta, currently only available through an online waiting list, is a simple web tool with three windows: one to type in commands, one that shows the code generated by those commands, and one that shows what the code does. You could theoretically use Codex for all sorts of tasks in over a dozen coding languages, but the coolest use I've seen is coding simple Javascript videogames with just a handful of natural language instructions.

Check out the video below from YouTuber Joy of Curiosity to see it in action.

It's pretty wild—the tool can easily handle simple commands like "make a black circle," but it can also correctly interpret commands that require context, like "make it smaller," and even multi-step instructions like "if the rectangle and the circle overlap, make the circle go in the opposite direction." In minutes, Joy of Curiosity has a crude version of Breakout up and running.

That's impressive, but I noticed a few instances where Joy intervened with little tweaks to the AI's attempt to code. OpenAI also made an official live demo of Codex's Javascript skills (zero intervention required) with a little spaceship game. It's cool how the tool leverages the OpenAI platform to have general knowledge about the world, like when the user tells Codex to "set background to the color of space," resulting in black. The commands get even more elaborate in this demo. With the single sentence beginning with "When the rocket is clicked," Codex successfully programs a boost mechanic that accelerates the ship in its current direction. By the end of the eight-minute demo, the game has scoring, a tutorial, and an objective.

I fully expect that the spaceship video is a manicured demonstration that plays toward OpenAI's strengths and avoids its weaknesses, but the magic of watching a simple phrase turn into actionable code seems very real. Now, even a math-averse person like me can be one of those game directors that points over his programmer's shoulder and says "make this faster, that needs more color." For a look at an alternate use of Codex, YouTuber Ania Kubów was able to make a snazzy (if simple) website to showcase her work.

I suspect Codex is still a long way from being useful for projects beyond demonstrations, but it's a fascinating glimpse at a potential future in which telling computers what to do doesn't require fluency in any language other than the one you learned to speak growing up, a la Star Trek. Concurrently, there's a growing interest among Silicon Valley investors in "low-code" or "no-code" tools that aim to make programming faster and simpler, and even accessible to those who aren't fluent in any coding languages.

OpenAI is still hiding Codex behind lock and key for now, but you can sign up for the waitlist for a chance at access. If I get access, my first goal is to instruct the AI to destroy itself. I'll let you know what happens.

Morgan Park
Staff Writer

Morgan has been writing for PC Gamer since 2018, first as a freelancer and currently as a staff writer. He has also appeared on Polygon, Kotaku, Fanbyte, and PCGamesN. Before freelancing, he spent most of high school and all of college writing at small gaming sites that didn't pay him. He's very happy to have a real job now. Morgan is a beat writer following the latest and greatest shooters and the communities that play them. He also writes general news, reviews, features, the occasional guide, and bad jokes in Slack. Twist his arm, and he'll even write about a boring strategy game. Please don't, though.

Read more
The OpenAI logo is being displayed on a smartphone with an AI brain visible in the background, in this photo illustration taken in Brussels, Belgium, on January 2, 2024. (Photo illustration by Jonathan Raa/NurPhoto via Getty Images)
OpenAI is working on a new AI model Sam Altman says is ‘good at creative writing’ but to me it reads like a 15-year-old's journal
An Ai face looks down on a human.
Xbox announces 'a generative AI model for gameplay ideation' called Muse, but don't get too excited: Machines aren't about to make games for you just yet
Microsoft Muse-generated gaming in action
'A massive, massive moment of wow.' Microsoft CEO predicts AI-generated games are a 'CGI moment' for the industry
OpenAI Operator
OpenAI's Operator is your new autonomous AI assistant ready to do your biding across the web
Razer Project Ava key visual
Razer has released a backseat gaming AI bot called Ava, and I'm not sure whether using it should be considered cheating or not
CHONGQING, CHINA - OCTOBER 30: In this photo illustration - The Facebook app page is displayed on a smartphone in the Apple App Store in front of the Meta Platforms, inc. logo on October 30, 2024 in Chongqing, China. (Photo by Cheng Xin/Getty Images)
Meta might've done something useful, pioneering an AI model that can interpret brain activity into sentences with 80% accuracy
Latest in AI
Closeup of the new Copilot key coming to Windows 11 PC keyboards
Microsoft co-authored paper suggests the regular use of gen-AI can leave users with a 'diminished skill for independent problem-solving' and at least one AI model seems to agree
Still image of Bastion holding a bird, taken from Microsoft's Copilot for Gaming reveal trailer
Microsoft unveils Copilot for Gaming, an AI-powered 'ultimate gaming sidekick' that will let you talk to your console so you don't have to talk to your friends
BURBANK, CALIFORNIA - AUGUST 15: Protestors attend the SAG-AFTRA Video Game Strike Picket on August 15, 2024 in Burbank, California. (Photo by Lila Seeley/Getty Images)
8 months into their strike, videogame voice actors say the industry's latest proposal is 'filled with alarming loopholes that will leave our members vulnerable to AI abuse'
live action Jimbo the Jester from Balatro holding a playing card and addressing the camera
LocalThunk forbids AI-generated art on the Balatro subreddit: 'I think it does real harm to artists of all kinds'
Aloy
'Creepy,' 'ghastly,' 'rancid': Viewers react to leaked video of Sony's AI-powered Aloy
Seattle, USA - Jul 24, 2022: The South Lake Union Google Headquarter entrance at sunset.
Google is rolling out an even more AI-heavy search engine mode because 'power users want AI responses for even more of their searches'
Latest in News
Will Poulter holding a CD ROM
'What are most games about? Killing': Black Mirror Season 7 includes a follow-up to 2018 interactive film Bandersnatch
Casper Van Dien in Starship Troopers
Sony, which is making a Helldivers 2 movie, is also making a new Starship Troopers movie, but it's not based on the Starship Troopers movie we already have
Assassin's Creed meets PUBG
Ubisoft is reportedly talking to Tencent about creating a new business entity to manage Assassin's Creed and other big games
Resident Evil Village - Lady Dimitrescu
'It really truly changed my life in every possible way': Lady Dimitrescu actor says her Resident Evil Village role was just as transformative for her as it was for roughly half the internet in 2021
Storm trooper hero
Another live service shooter is getting shut down, this time before it even launched on Steam
Possibility Space concept art.
Possibility Space owners sue NetEase for $900 million over allegations it spread 'false and defamatory rumors' of fraud at the studio that ultimately forced it to close