%% ZeroContextExample entries are not allowed on wiki pages. All such entries have been commented out. Add context to the entries before uncommenting them.
A game, usually a PuzzleGame or a SimulationGame, in which the player has little to no direct control over the game's events. Instead, the player's task is to set up the solution, then hit a "go" switch to activate the solution and see if it accomplishes the task correctly. Setting up the solution may require enqueuing objects with a list of commands to follow, or arranging objects on the game board to change the way they react to one another. If the solution contains elements of randomness or is particularly complex, the player will need to perform [[TrialAndErrorGameplay many unsuccessful test runs]] to adjust the solution before finding one that works.

Programming games usually have no playable characters, but sometimes one will exist for the purpose of setting up and activating the solutions. It is also common for the game to allow a limited measure of user activity while a solution is running, by means of the playable character or otherwise, but the player will need to design the solution with this interaction in mind and plan ahead for it.

Not to be confused with InteractiveFiction. Other genres of game can have elements of this through GameplayAutomation.
* ''VideoGame/TheIncredibleMachine'' was one of the first such games and the TropeCodifier for many of the common elements of the genre (no characters, using an array of items that react to each other in various ways to set up a field to achieve a certain goal upon activation, steep difficulty curve).
* ''VideoGame/ArmadilloRun'', that makes use of a physics engine. Set up a bunch of platforms and ropes of varying material, start the process, and hope your armadillo (actually a ball) finds its way to the portal.
* Every game by Creator/ZachtronicsIndustries (former tagline “games for engineers”). Most notably:
** ''VideoGame/TheCodexOfAlchemicalEngineering''. Quoting the description, 'As an Alchemical Engineer, you must build machines out of mechanical arms and magical glyphs that transform and combine atoms in order to create the compounds required for each level.'
** ''VideoGame/{{KOHCTPYKTOPEngineerOfThePeople}}'': design integrated circuits to meet set tasks by laying out doped silicon.
*** The above word is a [[TheBackwardsR Roman-alphabet approximation]] of a Cyrillic-alphabet word, pronounced "konstruktor".
** ''VideoGame/SpaceChem''. Each 'reactor' is effectively a [[http://en.wikipedia.org/wiki/Finite-state_machine finite-state machine.]] (Arguably a refinement of Codex.)
** ''VideoGame/{{Infinifactory}}'' has you designing manufacturing processes to take inputs and manipulate them to produce outputs. It's often described as a 3D version of ''VideoGame/SpaceChem'', though it does have a different tool set and is considerably easier.
** ''VideoGame/TIS100'' is the purest example of this trope, since it involves you literally programming an emulated fictional microprocessor using ''Assembly language''.
* ''VideoGame/FinalFantasyXII'' has you set up conditions that the AI-controlled characters use to fight -- unless, of course, you want to control all of them yourself, which is an entirely valid option.
* ''Franchise/DragonAge'' has combat tactics, simple AI-type selection and a list of conditions and responses. Since the player can only control one character in real time, you have to either rely on these, or pause every split second to micromanage. In ''[[VideoGame/DragonAgeOrigins Origins]]'', the number of available tactics slots (condition-reaction pairs) pro companion was determined by character level and a specific skill level, but only by the former in ''VideoGame/DragonAgeII''.
%%* ''Robo Sport''
* The ''VideoGame/DrBrain'' series is quite fond of these. All four games have a programming puzzle in them.
** In ''Castle of Dr Brain'', it's a simple maze with three important objects. If you play on Standard or Expert, the robot heads break after success, and only one of the three follows your program exactly as written. The others are one which always does the opposite of what you tell it, and the other alternates between obeying and the opposite instruction.
** In ''The Island of Dr Brain'', you're programming a robot to retrieve packages from around a randomised lab. One cartridge has the robot behave normally, one has random bugs (which make it do the opposite of the written instruction) and the third one makes the robot stop and watch any monitor it goes past! Unsurprisingly, anyone using the third cartridge will be trying to make the robot's route avoid monitors. Oh, and on the harder difficulties, the cartridges burn out after the robot successfully delivers a crate to you, forcing you to use all three, just like the robot heads in the first game.
** In ''The Lost Mind of Dr Brain'', you're programming an icon of Dr Brain to collect brain icons. Novice difficulty restricts programming to just the seven-line Main program. Expert and Genius have, respectively, one and two subroutines and a lot more brains to collect.
** In ''The Time Warp Of Dr Brain'' there's a bunch of cars which need to get to the appropriate parking spaces. In this version color-coded instructions are placed at the intersections, and cars will follow any appropriately-colored instructions they come across. Harder difficulties add obstacle vehicles which follow predetermined paths and multiple cars of the same color, and even though same-colored cars have interchangeable parking spots each spot can only hold one car.
* ''VideoGame/ElseHeartbreak'' has a programming language, Sprak, which the computers, and other various things, run on. The player can use a modifier to change the code within various objects.
* The boardgame ''TabletopGame/RoboRally'' is something of a programming game. At the start of each turn, you 'program' the moves for your robot (turn, move forward, move backward, etc), and hope none of the other players' robots get in your way. It's a very fun game.
* The lesser-known boardgame ''TabletopGame/{{Robotanks}}'' has you controlling a team of four tanks, setting each with its own stack of order cards and having limited ability to reprogram them. Normally you're reprogramming one a turn while the others go around doing whatever you last told them to do.
%%* ''Cybugs''
%%* ''VideoGame/{{NERO}}'' is a freeware RealTimeStrategy game that features this.
* ''VideoGame/FireProWrestlingG'' had an Edit Ranking mode, where you design the AI for a Create-A-Wrestler and pit him against a ladder of opponents, the objective being to design a character who can make it all the way through. ''Fire Pro Wrestling D'' goes one better, allowing you to have the AI play through the game's season mode, essentially turning the whole game into a Programming Game.
* ''VideoGame/CoreWars'' is frickin' hardcore. Hoo-ah. HOO-AH!
** For the uninitiated, ''Core Wars'' is a simulation of an old-fashioned computer's memory. Players write programs in Redcode (an assembler-style language) to attack other programs; common tactics include attempting to overwrite, crash, or enslave by various means. Competitions are generally one-on-one, with a King Of The Hill format being typical for most servers and some tournaments.
* Creator/{{Origin}} (of ''Ultima'' and ''Syndicate'' fame) published a game called ''VideoGame/{{Omega}}'' where you programmed robotic tanks using a structured form of BASIC, then set them battling each other.
* ''VideoGame/{{Globulation2}}'' is a partial example. It's freeware game which doesn't let you directly control your units; instead, you give various "orders" to all of your units of a certain type, and the game's AI takes over. For example, instead of leading your soldiers directly into an enemy base, you drop an "invasion flag," which attracts soldiers to come and knock stuff over. Workers are controlled by clicking on the building you want staffed and assigning more workers to it. You set a "forbidden zone" where you don't want the to go and "clear area" where you want workers to collect crops or wood. And units will automatically check out any new upgrade building you make. This concept wouldn't work if it weren't for the game's aversion of ArtificialStupidity.
* The Neo Geo Pocket Color game ''VideoGame/{{Faselei}}'' was played by loading commands into the CPU of your [[AMechByAnyOtherName Toy Soldier]]. Naturally, upgrades included the amount of commands you could execute in a turn, the amount of commands you could store in your CPU, and the quality and versatility of the commands themselves.
* The strategy game ''VideoGame/{{Spartan}}'' is like this. In an effort to simulate the difficulty of communicating over the din of battle on ancient battlefields and the rarity of complex tactics, it gives you a limited number of commands you can issue at the start of battle and only three options (all charge, rally, and all retreat) for modifying your army's behavior in the midst of combat. ''The History Channel: Great Battles of Rome'' uses a modified version of the same engine which allows a limited degree of direct control over your units during battle, but it remains a partial example.
* An old [=PlayStation=] RealTimeStrategy game called ''VideoGame/CarnageHeart'' involved programming an army of mecha, essentially constructing flowcharts to determine their actions.
* ''VideoGame/{{Toribash}}'' somewhat fits into this category. Two players fight each other with 3D stickmen, but they have to control all limbs individually. Each player gets about 20 seconds to make adjustments, then the fight advances slightly, adjust again until pre-determined victory conditions are set.
* ''{{VideoGame/Colobot}}'' allows you to write your very own AI for the titular bots.
* There was a ''Series/DoctorWho'' platform game on the Commodore 64, where Colin Baker's Doctor had a robot cat, Splinx, which could be programmed through a series of simple commands to go to various markers (which you can drop or throw), pick things up, put them down, return to the Doctor, and so forth. Since Splinx was invisible and invulnerable to the many monsters, this was the technique of choice for getting objects out of dangerous territory. It probably helped that most C64 users had some exposure to programming anyway, since BASIC was pretty much the C64's entire operating system.
* ''VideoGame/{{GranTurismo4}}'' has the B-Spec mode, where the AI controls the car and you specify how hard it should be with the throttle (which affects the life of your tires and your fuel tank), as well as when it should pass or pit-stop. You can also control the simulation speed. While it's not very impressive, it becomes quite useful to clear the endurance races, which can be as long as ''24 simulated hours''.
* ''VideoGame/RobotOdysseyEscapefromRobotropolis'' was a game created by Creator/TheLearningCompany using the engine from ''Adventure'', the famous Atari game where you had to program and coordinate the efforts of a handful of robots to complete specific goals to escape the titular city. The method used for programming? [[http://en.wikipedia.org/wiki/Logic_gate Logic gates]]. There's a reason that the game was at one time considered a good tutorial for Digital Logic college courses.
* Sports management games such as ''VideoGame/FootballManager'', in which the manager chooses their team and sets tactics to use during each match, but does not directly control any of the players.
* ''VideoGame/{{Zork2}}'' has a robot that follows the same sort of English commands you use to control your own character.
** You could tell any NPC to do something, and the interpreter would understand that's what you were trying to do. The robot was one of those rare characters that more or less followed any order that it could.
* ''Videogame/{{Robozzle}}'' is a rather advanced web bot programming game, involving both [[http://en.wikipedia.org/wiki/Subprograms subprograms]] and [[http://en.wikipedia.org/wiki/Recursion recursion]]. Once you have solved 40 puzzles, you can even add your own puzzles.
* ''Videogame/TheRobotClub'' is an obscure robot-building game that's most notable for it's wide variety of silly parts (i.e. "poop detector") and laughably [[{{Narm}} Narmic]] GreenAesop.
* In ''Videogame/GratuitousSpaceBattles'', you design ships, construct a fleet, and issue orders. The individual captains then follow their own initiative within the confines of those orders.
** The developer eventually added an option to give orders in battle that brought the game out of the Programming genre and straight into RealTimeStrategy.
* ''VideoGame/AIWars'' is an interesting game where you write the AI of either robotic bugs in Insect Wars or tanks in Armor Commander using a special programming language for the game, available [[http://www.tacticalneuronics.com/content/aiw3dnew.asp here]].
* In ''VideoGame/DwarfFortress'', you can decide who goes into the military, who's allowed to do what, and what needs to be done, but ultimately it's up to your dwarves to decide who does it, and when and with what it gets done.
** With the use of zoning, everything in the fortress can become automated except for mining, timber, and trade. With the use of patrol pathing, theoretically the military can be automated, but in practice a player would want finer realtime control over combat engagement.
* The Creator/AvalonHill board game ''VideoGame/{{Gunslinger}}''. The players program action sequences much like in TabletopGame/RoboRally, but different actions take different time. You can spend actions totalling up to 5 segments, representing two seconds of game time.
* ''VideoGame/ChipWits'' has you assemble the eponymous robots' flowchart-style AI out of draggable icons. It's one of the few Programming Games aimed at children.
* A series of two burglary-based games called ''VideoGame/TheClue'' and ''VideoGame/TheSting'' went a step further with this. You had to plan an entire burglary from start to finish, by issuing exact orders and timings to each of your burglars. Then, you'd watch the heist take place and hope your plan would work out as well as it did in the training.
%% http://www.brothersoft.com/games/mindrover.html
* ''VideoGame/MindRoverTheEuropaProject'' is a vehicle-based 3rd-person shooter where you preprogram the vehicles to fight each other using a visual programming interface. (There are also race and 'sumo' modes). The premise is also pretty entertaining: basically there are a bunch of scientists working on Jupiter's moon Europa and they're boooooored. Programming the miniature vehicles called 'Rovers' to fight each other is just their way of killing time...
%% http://galaxyhack.sourceforge.net/screenshots.php
* ''VideoGame/GalaxyHack'' sets entire fleets of spaceships against each other, helpless except for the AI you write and assign them. Oh, and their weapons.
%%* The (now open-source) robot fighting game ''Roboforge'' is built around this.
* The dojo missions in ''VideoGame/WarioWare DIY'' have you finishing the programing for microgames. While usually only one or two instructions are needed, the coding is quite dependent on understanding the tricks used to dodge engine limits.
* Episode 3 of ''VideoGame/StrongBadsCoolGameForAttractivePeople'' features a cross between this and ScriptSwap. You can change the order of records in the Two-O-Duo's set (and add two from elsewhere), and Bubs (The DJ) will play them in order, scratching each so that it sounds like a movement instruction. His rap partner Coach Z, dancing on stage, will follow these instructions - even the useless 'do the Wigglie'. [[spoiler:The goal is to get Coach Z to punch Bubs in the face.]]
* ''VideoGame/PacMan2TheNewAdventures'' swapped out traditional Pac-Man gameplay for a combination of this and EscortMission. The player gives directions to Pac-Man... who may or may not actually choose to follow them, depending on his mood.
* ''VideoGame/CosmicSupremacy'' Fixes the micromanagement bloat of 4X games and the requirement to be online at all times in a persistent real time strategy by letting the player script almost all the economy management and much of the combat.
* ''Videogame/ChuChuRocket'' presents you with the stage and where the [=ChuChus=] and [=KapuKapus=] will spawn and requires you to lay down arrows at strategic points to change the direction of the [=ChuChus=] and/or [=KapuKapus=] (who will otherwise move in a straight line until they reach a wall, at which point they will turn right if possible). Once you've placed the arrows, the only effect you have on the game is to start everything moving and hope they go where you want them to.
* ''Franchise/ProfessorLayton'' loves these. Frequently, they are given as toys for young Luke to play with -- such as car and train tracks, where you have to set up a route for the car and train to take. This is also employed for the designated pets of each game -- a hamster in ''Diabolical Box'', a parrot in ''Unwound Future'', and a goldfish in ''Spectre's Call'', setting up routes for each pet to take on their respective tasks. The latter of the series also has a couple puzzles like this where someone is attempting to bounce an item (a watermelon, an apple, and a ''bomb'' in the OldSaveBonus puzzles) across to their friend.
* An old edutainment game by the name of ''Leap Frog'' (or similar) tasked the player with guiding a frog to the home lily pad by inputting a series of up to four instructions, which looped until the frog made it home or fell into the water. For example, you might program 3 right, 2 up, 4 right, 1 down. The levels worked by generating a path of lily pads that could be followed by correctly programming the frog, and harder difficulties also added random lily pads to obfuscate the correct path.
* The game ''VideoGame/{{Lightbot}}'' by CoolioNiato features a robot that the player has to program with "command blocks" such as "right" or "jump" in order to light up all the tiles in a given level. The game was featured in CSEdWeek's Hour of Code.
* As a partial example, [[VideoGame/ArmoredCore Armored Core Verdict Day]] has this in the form of [=UNACs=] (Short for [=UNmanned=] [=ACs=]). Not only you get to determine their loadouts, you get to create their own AI via an full-blown in-game logic programming system [[note]]The same programming which has been evolved by FROM Software themselves as ''the'' AI programming for every enemy behavior since the very first Armored Core game in 1997, according to WordOfGod [[/note]].
** Arguably, while you can issue rudimentary commands to your "party" while fighting, being in Operator mode is more useful as it lets you modify the AI logic's priorities, essentially modifying their behavior on-the-fly. In short, how good the AI performs is entirely dependent on you, the programmer.
* ''VideoGame/{{Scriptarians}}'' is an unusual example: it's a fantasy game about two teams of adventurers fighting each other, but the gameplay consists entirely of programming your adventurers' AI in a C-like language, then just sitting back and watching them duke it out.
* ''VideoGame/{{Untrusted}}'', ([[http://alexnisnevich.github.io/untrusted/ Found here]]), exaggerates this trope. Though initially the game looks like a roguelike, the main draw of the game is using Javascript to edit each level. Beginning tasks include removing obstacles, creating walls to block an attack drone, and revealing the locations of hidden mines.
* The "See the Dalek from a different angle" minigames in ''The Doctor and the Dalek'', since it was intended as an EdutainmentGame to teach kids the basics of programming.
* ''VideoGame/{{Robugs}}'' was a freeware Atari-ST game where the logic "Circuits" defined the physical appearance of the "Robug"; you could design various teams and have them have at it. There appears to be a new [[http://robugs3d.sourceforge.net/ Robugs 3D]] beta on Sourceforge, but it has been some time since it was updated.
* ''VideoGame/HumanResourceMachine'' has you program the actions of an office worker. Tasks are rather abstract and include math computations, array lookups, string sorting and similar problems.
* ''VideoGame/PonyIsland'' has this as a large part of the game. The goal is to get a key icon to the end command by placing command blocks to make it go down, left, right, back to the start (which means failure in most cases), or more advanced things like portal blocks (if the key reaches one, it skips to the other) or a "splitter" that makes the key go down, but creates a second one on the right. Later puzzles also require passing through certain bits of code enough times to bring variables to a correct value, while avoiding code that will reset the values.One portion also mixes things up by [[spoiler:forcing you to pick the commands in a certain order while also having a demon automatically place one command for each you place or move ]].
* The Board Game ''Pony Express'', although not obviously computer themed, has the players programming actions for bandits raiding a train.
* Averted for humorous purposes by ''VideoGame/DandyDungeon''. It sells itself as "the world's first '''R'''omance '''P'''rogramming '''G'''ame" ([[FunWithAcronyms check out the initials]]), but while the main character is a programmer you don't have to program anything, instead it's more of a puzzle game where you have to set a track to cover the whole dungeon grid. It's not a real RPG either, it's all part of its nature as an AffectionateParody of video game industry.