Bonum Certa Men Certa

All Software Should Come With a Cheat Mode

Article by figosdev

Dice



Summary: Cheat modes are useful for developers because they enable debugging, and are sometimes called "Debug mode"

This article is more about an ideal than a hard rule, but it's an ideal that I want to encourage.



Lately I've been teaching a little about minicomputers, as a different perspective on coding and program design. I don't know a lot about minicomputers, but then I'm not teaching expert-level stuff either. In the process, I've learned some cool things myself. I am happy to note that there are people I can consult about and discuss minicomputers with who have actually worked with them.

One of the things that is very cool about minicomputers, is that some have a "cheat mode" even for the CPU itself. I was going to call this article "all software should be programmable", but then I realised that cheat modes were not just a great metaphor for what I mean, they're a good example.

I did not play all that many games on computers, at any point since I learned how to use them. I played Ghostbusters on a PCjr connected to a television, I played with an Atari 2600 before most people had ever played Mario on an 8-bit console, I played Tetris and Solitaire, and I played a handful of DOS games -- including Monuments of Mars and Commander Keen.

"Cheat modes are useful for developers because they enable debugging, and are sometimes called "Debug mode"."My original experience with computing (other than a few month stint with an 8-bit cassette-based Timex Sinclair) was a command prompt, a graphical, mouse-driven DOS application for drawing, and a manual for writing in BASIC. I would eventually learn that changing the code in BASIC programs was a lot of fun (and extremely educational) but it gave me an opportunity to try a lot of programs for free -- you could just borrow (or purchase) a magazine or book from the library or a friend, and start typing things in.

Monuments of Mars was a simple CGA game that I honestly thought was one of the coolest things ever. The graphics were simple, but the structures put together with sprites (along with aliens and robots that had only two to five frame "animation") were something I found exciting. Jumping up to shoot switches to turn them on and off was also cool.

I did eventually go to the trouble of beating both Commander Keen and Monuments of Mars without cheating, of course. But I honestly found cheating was more fun. At the time, I was more interested in the possibility of making games than playing them, and I wanted to explore the levels more than I wanted to jump up and shoot robots. Obviously, straight game play did demonstrate things that cheat mode did not -- like how far a jump will actually get you when it's not unlimited and basically flying.

Cheat modes are useful for developers because they enable debugging, and are sometimes called "Debug mode". This is also true of ODT mode for some late-model PDP-11 machines. But the cool thing about cheat mode, whether you're talking about a minicomputer CPU or Commander Keen, is that a lot of boundaries created by the game are transcended. This is something we generally want in our programs.

"The term window is a bit like "cheat mode", especially when you're root."It's a unique feeling to suddenly be able to walk through walls, fly around, visit game levels that were inaccessible or discover hidden levels and easter eggs. When you're writing code, a lot of this is simply the nature of being able to tell the computer what to do. And there are levels of accessibility, to be sure -- I don't have to recompile the operating system to be able to open a term window and become root. The term window is a bit like "cheat mode", especially when you're root.

Obviously I'm not saying that administrators shouldn't be able to lock down certain features, including root and sudo -- but the owner of the computer should be able to override everything; that's one of the promises of Free software. But this idea is about exposing a bit more power to the user, for those who would use it.

And it's not a new idea -- ODT mode on the PDP-11 let you change any value at any address. BASIC let you do more or less this with the PEEK and POKE commands. The Sugar platform was designed for a laptop that had a "View Source" key that was meant for native applications, not just HTML and JavaScript. And various games let you use cheats to add points, ammo, health and extra lives.

Before Minecraft, the Sims let you build a house with unlimited access to materials. I was more interested in putting weird houses together than actually playing. If I was using Minetest, it would be the same. It's cool that Minecraft is also a game, but what I really want is a voxel building application.

"This is a fun way to introduce the concept of variables and coding to users."Having explored some of the recent Unity-based games designed to teach coding -- I'm not interested in promoting them, though I did want to be able to rate and explain the concept -- for some of them, "cheating" (debugging the playing field) is really one of the goals of native game play. If you want to cross a bridge, the way you do that is by loading the bridge values in a widget and changing them so the bridge is long enough to cross.

This is a fun way to introduce the concept of variables and coding to users. You could put this sort of thing in so many games, including ones that aren't written for a non-free engine; instead of just having a cheat mode, you could make it so the player could bring up an option to "hack" individual objects in the game.

For Monuments of Mars, which came out decades earlier -- I found that save games were basically two bytes -- one was the ASCII value for the saved level (there were only about 20 levels per game) and the other was an ASCII value for how many charges you had left for the gun. Rewriting this binary file using BASIC (or a hex editor, though writing a few reusable lines of BASIC for the task was satisfying) was extremely fun for a beginner.

I also put a cheat mode in the text editor I'm using / extending / writing. The goal is to have something to use instead of Leafpad. It doesn't have proper word wrap (it just wraps around mid-word like the cat command does) but it does let me pipe text to it like a graphical version of "less" and CTRL-T runs whatever text is on a certain line as a shell command. So for example, there is no word count feature, but while I'm typing this I can hit CTRL-S to save and then type:

    wc cheatmode.txt


And if I hit CTRL-T then it tells me how many lines, words and characters the file I'm writing has. I could also open a term and do that, but this lets me do it right from the text editor. Then I just select the output, delete it and keep working.

This is more than a way to have features available before I even implement them. It means that I don't have to copy text to and from the term window nearly as much. Output is piped directly into the editor, and every line of text in the editor is a line of text I can run.

People who use programmable text editors already know how cool it is to be able to do this, but I don't really love Vi or Emacs. I use GNU Nano and Leafpad -- these are not editors known for a lot of features. I like them for their simplicity, and if I make a programmable text editor it's going to be designed for simplicity as well. Suppose I want to run some figplus code:

    figplus
    p "hello world" split p " "
    forin each p
        c randint 1 15
        now each colourtext c print
        next


Then I select those lines of text and hit CTRL-T again. This isn't implemented yet, though the first line of the selection would be "figplus" -- telling it I want to run "figplus" code. It then treats the rest of the selection the way it's designed to treat selections that begin with that keyword. Since a child process can't change the cwd of a parent process natively, I've already implemented a "cd " command that changes the cwd for the editor process via os.chdir. If Leafpad had this I would use it!

I could take all the code for figplus and stick it in the code for the editor, but since this creates a second version of figplus to maintain, I think I will just have it call figplus from the shell -- much easier to implement and maintain for snippets of fig code (doing it this way will create a few limitations).

I could have it simply save the code to a file, compile and run it -- and if I make it process standard "fig" that is how I will most likely implement it. But just to extend the capabilities beyond shell code, all it needs to do is take these lines:

    p "hello world" split p " "
    forin each p
        c randint 1 15
        now each colourtext c print
        next


-- put a newline between them:

    p "hello world" split p " "\nforin each p\n    c randint 1 15\n   
    now each colourtext c print\n    next





-- change the double quotes to single:

    p 'hello world' split p ' "\nforin each p\n    c randint 1 15\n   
    now each colourtext c print\n    next





-- and add double quotes to each side and call with figplus:

    os.system("figplus05.py -c " + chr(34) + 
    "p 'hello world' split p ' '\nforin each p\n    c randint 1 15\n 
    now each colourtext c print\n    next" + chr(34))





Then CTRL-T can run fig code as well as shell code. And we can add other commands too, like:

    append-to log.txt
    These lines will
    be appended to
    the log file.





Highlight that, CTRL-T, it writes what I've highlighted to a file. The only tokens processed by the editor are "append-to" and "log.txt".

Again, this is not the first editor that does stuff like this. But it's written in Python, it's PyPy-compatible, and it's designed the way I like it. The lack of a Code-of-Conduct is just a bonus.

To distinguish "all software should have a cheat mode or be programmable" from something like "all software should be as insecure as browsers with DirectX support, let's note a couple of things here:

The editor doesn't actually DO ANYTHING with the text when it loads. It doesn't get parsed, no automatic actions are taken.

To run code, you have to hit CTRL-T on a line that has code on it, or select code and hit CTRL-T where it recognises the first line of the selection. This is nothing like JavaScript, which runs when it's loaded and parses the entire document. It's not even like HTML.

"Different programs benefit from different cheat modes."The entire document is just text -- it may not even contain code, but the editor has no idea if it does or not until you highlight something and ask it to run what's highlighted.

Different programs benefit from different cheat modes. A video game that lets you change how long a bridge is might not benefit from calling shell code (it probably won't, unless the game design is very unusual). JavaScript might pose a security risk to the user sometimes, but the JavaScript console itself is less likely to.

One thing that saddens me at times about JavaScript (and HTML) is how complex it has gotten. To have a "cheat mode" or be programmable, I don't think every application needs a full-fledged, general-purpose scripting language. Though that's one way of doing it.

Simple languages with a handful of commands (10 to 100, just for some simple features) with simple syntax provide enough of a window to the program, to get more people interested in programming and computing in general. Sometimes you may need more than that, which is alright. But I'm still talking about all this in the context of homemade software I think corporate software should have features like this as well, but sometimes (as with Minecraft, Mozilla and LibreOffice) corporate software already is programmable or has debug or cheat modes.

As for the amount of work it took to add shell code processing to a text editor, I can actually grep the code while I'm writing this:

    nl = chr(10) ; from os import popen as po
    cmd = self.textarea.get(1.0,tk.END).split(nl) # get text
    cmd = cmd[int(self.textarea.index(tk.INSERT).split(".")[0]) - 1] # get line cursor is at
    f = po(cmd.split(nl)[0]) # call shell
    self.textarea.insert(tk.INSERT, nl + f.read().rstrip() + " " + nl) # update editor
    self.textarea.bind('<Control-t>', self.find_file)


This is slightly abbreviated, but basically what I added to make the feature possible. I've since added the ability to background processes with & (which first indicates the desire to background, and then is passed to the shell).

"...sometimes (as with Minecraft, Mozilla and LibreOffice) corporate software already is programmable or has debug or cheat modes."Adding a cheat mode doesn't have to require redesigning the entire program. It just takes thinking about what would allow the user to transcend the usual boundaries and assumptions of the program they're using -- to create an interesting and perhaps useful new window into the program itself.

As for snippets of code, particularly shell code and quick scripts, how can those have a cheat mode? In my opinion, if you're running a line of easy-to-edit shell code or a few lines of Python, you're in "cheat mode" already. Though for applications substantial enough to consider adding a feature, it's worth thinking about what sort of code you could use within the running application -- partly to make it more useful, and partly for the sake of education and encouraging the next generation of coders.

leafpad cheatmode.txt & # (I haven't added font sizes to the editor yet; this will make it easier to proofread) &

Long live rms, and happy hacking.

Licence: Creative Commons CC0 1.0 (public domain)

Recent Techrights' Posts

IBM HR "Process is Similar to Raising Farm Animals"
IBM "silent layoffs" won't stop
Brett Wilson LLP Has Just Lost a Case of Its Biggest Client "IN THE COURT OF APPEAL (CIVIL DIVISION)"
Is Brett Wilson LLP proud of such clientele?
Gary Smith Says Brett Wilson LLP Engages in SLAPP Against Him Over LinkedIn Post, "This is the Streisand Effect in Real Time"
"Lawyers who front SLAPP‑style threats on behalf of powerful institutions are not “defending reputation”; they are abusing legal process to intimidate and silence legitimate public‑interest scrutiny."
 
Links 02/07/2026: China "Ethnic Unity" Law a Global Threat, "EU Imposes €3 Duty on Parcels From China"
Links for the day
Japan's Share of GNU/Linux Has More Than Doubled
GNU/Linux now sits around 3.5% compared to about 1% two years ago
'Largest Single Layoff Event In Gaming History' or 'Largest Single Layoff Event In Microsoft History'?
we need whistleblowers, not official or semi-official statements from Microsoft
Off-putting Terms or Behaviour That Keep Women Away From Areas of Technology (Not What IBM and GAFAM Tell Us)
the use of language
Microsoft Windows "Goes South" in South America, GNU/Linux Popularity Soaring
Brazil and its neighbours must have paid attention to what happened earlier this year in Venezuela
It's Not the Layoffs, It's the Debt
PIPs and/or "silent layoffs" are about the companies flouting obligations to staff, reducing or eliminating the compensation packages
European Patent Office (EPO) Series: Cutting Ribbons in Sintra While the EPO Burns
Like the Roman Emperor Nero, Campinos fiddles in Sintra while the EPO burns
In Spain, GNU/Linux Now Measured at 5.5%
Microsoft and Windows are generally shrinking
North America: GNU/Linux Leaps to 8% "Market Share"
the trend is clear
statCounter: GNU/Linux Has Risen to All-Time High of 6% Worldwide (July 2026)
GNU/Linux has massive gains
Not Tolerating Death Threats
Death threads are a serious matter
Silent Layoffs, 'Happy' Layoffs, and 'Buyouts' (Pretending to Voluntarily Retire)
We've been seeing lots of that at IBM and Microsoft
SLAPP Censorship - Part 125 Out of 200: Litigants in Person (LIPs) Handling American Lawfare Funded by Third Parties (About a Million Pounds for 100 Kilograms of Legal Papers)
An appeal to the Court of Appeal can be justified at one point
Attacks on the Sites
These are clearly censorship attempts
Links 02/07/2026: Microsoft May be Shutting Down 5+ Studios, Slop Got Too Expensive, "RAMpocalypse" Discussed
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, July 01, 2026
IRC logs for Wednesday, July 01, 2026
Gemini Links 02/07/2026: Kondo, Theological Thought, and X4
Links for the day
Links 01/07/2026: Apple and Microsoft Price Hikes, Political Catchup
Links for the day
Parroting the Script of RAs and PIPs, "Buyouts" and Layoffs by Any Other Name
Over time people will find out just how many people "leave" IBM
Slop Gives No Real Edge, It's Just Falsely Marketed That Way (FOMO)
Plagiarism in some measurable form is always bad, irrespective of what we call it
The Microsoft-Owned Media Shows What Spin Microsoft Will Use Amid Mass Layoffs
Microsoft says goodbye to over 10,000 workers this month
The Media is Shooting Its Own Foot by Peddling Slop and Spam
Nobody wishes to read slop; as soon as people realise "the news" (or "news site") is LLM trash, they will walk away
Gemini Links 01/07/2026: Wild Flowers, Slop, and Waystone Tools
Links for the day
Links 01/07/2026: Bending Spoons Makes an 'Exit' ("Going Public"), US Supreme Court Rules on Many Issues
Links for the day
Misattributing Blame, the Core Issue is Slop
that issue has nothing to do with Bash
Microsoft: Layoffs Are an Investment
Sales of the console will take another plunge and debt will skyrocket
Links 01/07/2026: MElon (Elon Musk) "Confronted With List of People He Has Killed", Microsoft Ignores Union, Chooses "Bloodbath"
Links for the day
The Register MS: Paid-For SPAM Advocating Chinese Colonialism in Africa, Not Even a Disclosure (as Before)
Does The Register MS recognise what this piece is promoting and who for?
Techrights Never Defended Rapists
In the past, I and others got falsely accused of "defend[ing] a rapist"
"Regular Silent Layoffs and PIPs" at Microsoft, According to Microsoft Insider
Many people leave without a fuss, only a signed NDA
Gaming Companies Help Promote Rootkits ('Anticheat') and Help Microsoft Take Control of People's PCs
The industry in its current form acts a bit more like a cabal of power-hungry companies that actively try to back-door everything and smear people who oppose that
IRC (Internet Relay Chat) Turns 38 Next Month
IRC did well because over 300k users are on significant networks (simultaneous, also counting bots and cross-network overlaps)
opensourceforu.com is a Slopfarm, It's Not "Open Source" and It's Not "For U"
Slop "For U"
DRM and Ownership
We now even have PCs that "expire"
GNU/Linux Reaches 6% in North America
Tomorrow around 10AM we'll see what preliminary data they get for July
IBM Layoffs Still Happening in 2026, They're Just Not Being Reported
The demise of IBM accompanies the demise of the media
SLAPP Censorship - Part 124 Out of 200: The Court Deems My Wife Connected to the Case of the Serial Strangler From Microsoft, Invites Her to the Hearing Last Week
Brett Wilson LLP does not play by the rules
Paying Severance to Staff Laid Off by Microsoft Too Expensive for Microsoft Now?
When companies earn such a bad reputation (not paying severance to people they discard) it lowers morale even further
Microsoft Mass Layoffs Due to Money Problems (Debt, Lack of Money to Complete Payroll), Not "Hey Hi"
If Microsoft later comes up with some "Hey Hi" narrative, then immediately reject it
Stop Conflating Free Software With Slop Plagiarism and Time-wasting
Even decades ago people could use "compute" for lots of fuzzing, then file away false or unaudited reports using bots
What Security Means
Security does not mean asking Microsoft for permission
Microsoft May be Losing 10,000+ Workers This Month
Here's the quick math
BSN Senior School Leidschenveen is Shutting Down and What That Means to the European Patent Office (EPO)
Follow-up meeting with Site Manager VP1 on school matters
Gemini Links 01/07/2026: Keeping (Relatively) Cool plus Adventures in Solar, Camp Snap Cameras and XTEINK X4 Ereader Reviews
Links for the day
European Patent Office (EPO) Series: Different Strokes For Different Folks
Organisation operating in two parallel universes
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, June 30, 2026
IRC logs for Tuesday, June 30, 2026
GNU/Linux Measured at 4.4% by statCounter, Even More by analytics.usa.gov
GNU/Linux has fared well
Getting Skyped: Closure of Studios Microsoft Bought
wait till July and the mass layoffs outside XBox
Several Waves of Red Hat Layoffs This Year, Is This Still Going on Under IBM?
The PIPs and NDAs hard to get a clear picture
Sabine Hossenfelder Versus IBM Scamming Shareholders
IBM has become a garage of BS
Some XBox Layoffs Underway, At Least Five Studios to be Shut Down
Insiders are in a state of panic
Gemini Links 30/06/2026: Music Theory, Addiction, Clown Computing
Links for the day
Links 30/06/2026: France Recorded 1,000 Excess Deaths During Heat Wave, Slop Replaced by Human Staff
Links for the day
WordPress Becoming What We Feared It Would Become
WordPress and other such bloatware (WordPress used to be fast and light) are moving in the same trajectory that GAFAM leads
People Given the Totally Wrong Idea That "Secure Boot" is About Security (It's the Opposite, It's About Handing Control Over to NSA/Microsoft)
"Secure Boot" with capital "B" is conflating compromise with security.
Today The Register MS is Publishing Fake Articles About "AI", 100% of All "Content"
Maybe the media is dying because it is selling its soul [...] The Register MS has no standard
America Has Cost Europe Too Much
Countries ought to be controlling all their own systems
GAFAM Debt Will Surge, in July We'll Know by How Much
Do not fall for slop or sloppy narratives
Call for European Patent Office (EPO) Whistleblowers
The European Patent Organisation (EPO) might not reform the Office
400-Page US Federal Court Against Abuses by Google, Microsoft and Front Groups That Abuse Volunteers for American Corporations
There are 386 pages in total (in the US claim)
Projection Tactics - Part IV: SLAPP by Americans Against Techrights (UK) to Hide Serious Abuses Against American Women
"PRs need to stop being complicit in suppression of information via SLAPPs"
Five Years Ago, After We Broke the Story About Richard Stallman Rejoining the FSF's Board, All Hell Broke Loose (for Me and My Family)
They generally seem to target anyone who thinks Richard Stallman (RMS) should be in charge or thinks alike about computing
Projection Tactics - Part II: Causing "Serious Harm" to Many People (Even Animals)
Narcissists and sociopaths are like that
Too Many "Marketers on the Payroll" at IBM, Selling Impossible Products That Cannot be Delivered or Will Never Deliver
IBM is rotting away
Media Says Microsoft's (XBox) Layoffs May be Record-Breaking
think somewhere in the range of ~5000 for gaming/XBox alone
Sirius Open Source's Latest Report: Fake (False) Number of Staff, Almost No Money in the Bank, Overdraft, and Growing Debt (About £100,000 More Borrowed)
massive (and still growing) debt
Links 30/06/2026: What's Wrong With EU Age Verification, RSA Keys with Many Zeros
Links for the day
This is Not a Security, This is a Circus
Security does not mean "asked Microsoft for permission"
Communities Need Strong Leadership, Not Dictators Like IBM
Leadership in Free software is not ownership [...] Fedora will only last as long as IBM can somehow make some money out of it or leverage it to attract sharecropping
Patents Are Not "Cash Cows"
People who deliberately don't understand patents (or believe lies about them) will fail to understand how the world works (or does not work)
Sad Lives of People Who Think Women Are Just Sexual Toys (All They Have is Money)
money is still a man-made concept and life is finite
SLAPP Censorship - Part 123 Out of 200: Why Violence Against Animals Matters
Starting tomorrow (Wednesday) we'll begin telling stories about what happened last week
EPO Staff Union's (SUEPO) The Hague Committee, With Help of Lawyer, Challenges Lack of Rewards for Hard Work
The EPO is not about granting valid patents anymore. The horse-trading corrupt officials just see the EPO as some thing that "prints money"
Massive EPO Demonstration Today
It'll start in about 6 hours
More Layoffs in Microsoft's PR Department, Even Ahead of 'D-Day'
Notice they are not even waiting for the official date (nor week)
European Patent Office (EPO) Series: Photo-Ops Galore and Suspicions of Influence-Peddling
coverage of the EPO's Croatian junket
Gemini Links 30/06/2026: Music and Broken Hearts
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, June 29, 2026
IRC logs for Monday, June 29, 2026