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

The Register MS Has Just Published Slop Spam for NVIDIA and HP, It Says "AI" 43 Times
As usual, The Register MS ought to be ashamed of itself for participating in it
The Slop Debt (Trillions of Dollars, Money That Does Not Exist) is Causing the Collapse of GAFAM et al
This slop hype will end up like "metaverse", except "metaverse" never ended up justifying trillions of dollars in "investment"
Social Control Media is the Opposite of Information
That says a lot about social control media
Lack of Empathy Rampant in the Sector
Sociopaths are sociopaths. They cannot help themselves
Before the "Big Tech" (That Almost Everybody is Forced to Use) Was Controlled by Men Who Hate Women
Such rejection and even hatred of women qualifies/enshrines oneself as an "incel"- a dangerous and violent online cult
Enshittification More Than a Century Ago
Is enshittification more than a century old?
GNU in 1991 (35 Years Ago): Compiler and Lots More Ready, Linux Now Becoming 'Vibe Heap' (Slop Replaces Real Code)
Without curbs in place, many Linux developers will flee
SLAPP Censorship - Part 147 Out of 200: The SLAPP Series is 'Slow' Because Timing Matters
It is important to stress that after this series is finished there will be many more series, with some of them showing raw evidence of what we've been illuminating and telling
 
Gemini Links 12/08/2026: Losing a Child, "The OpenWeb Needs Diversity", and Gmail Woes
Links for the day
Voluntary' Layoffs and 'Proper' Layoffs at IBM This Year
When will IBM management confess that 15% of staff is already marked for potential removal?
Links 12/08/2026: Trouble in Proprietary Chaffbot Company 'Open' 'AI' and Slop "Investors Are Suddenly Quaking in Their Boots"
Links for the day
Daniel Pocock in National News in Australia the Day of the Election
"Posted 20m ago" (Thursday in Australia), it's timed nicely to help illuminate Pocock and give him last-minute exposure
Simpler Means More Reliable
The simple old way of local storage and local backups is still the best
Clownflare and statCounter See GNU/Linux at ~8% in Norway
Norway has long championed GNU/Linux compared to the rest of Europe
Clacton manifesto: Reform UK hacking, leaks, raw sewage & 8GB Swiss Archive
Reprinted with permission from Daniel Pocock
statCounter Today: ChromeOS + GNU/Linux Measured at 10.98% Globally (Desktops and Laptops)
Clownflare does not quite refute this
The Register MS Has Just Published Fake Article About Replacing Linux With Proprietary Google System, "Sponsored by ASUS."
All of those things are proprietary GAFAMware
Links 12/08/2026: "X’s Advertising Business Continues to Tank", "Stop Feeding the Billionaires"
Links for the day
In Defence of Hoarding CDs, More So When Digital Restrictions (DRM) Come to More 'Content' and Even Offline/Physical Media Won't Work When Some Remote Server Says "No" (or Goes Offline)
made to serve and entertain owners, not to allow companies like Sony and Microsoft subjugate owners
Clownflare: In Finland, Birthplace of Linux Kernel, GNU/Linux Now Bigger Than Apple's MacOS
It's not just in Finland where we see such trends
More Mass Layoffs Due to Monumental Debt Excused as "Investment" (in Slop)
They're maxing up the private debt and their country is already insolvent
METRO Interviews Daniel Pocock a Day Before Election
The article is behind a wall that blocks people who block ads
Company-Wide 'Reorg' ('Redundancies') at IBM, Mark October 1st 2026 in the Calendar
Is Oct 1 the new Apr 1?
Even ZDNet Accepts That "Market Share" of GNU/Linux May Have Doubled on Desktops and Laptops
GNU/Linux is definitely growing, and quite quickly in fact
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, August 11, 2026
IRC logs for Tuesday, August 11, 2026
Microsoft Layoffs and Shutdowns Continue This August, Morale Low, Employees Set Up Giant Inflatable Rat to Protest Against CEO
nothing demonstrates their anger better than what they did to the CEO
Gemini Links 12/08/2026: Sophomore Slump, Mandatory Phone Addiction, and Vintage Web Game Gallery
Links for the day
Summer Layoffs and 'Redundancies' (Cost-Cutting) at Microsoft and IBM
IBM is merely buying its revenue - an unsustainable strategy that aims to hide the company's rapid decline
Links 11/08/2026: Tensions South of China and Stingy "YouTube Doubles the Eligibility Requirements" (to Get Paid)
Links for the day
The Independent (UK) Today: "Independent candidate Daniel Pocock is concerned about media issues."
Let's see what results say around Friday
Gemini Links 11/08/2026: Stargate, Stargazer, Air-gapped Environments, and SystemVerilog Simulator
Links for the day
The Slop ('Linux') Foundation Celebrates 35 'Linux' Years a Week After GNU/Linux Turns 43
they'll keep on trying to change history
Keumars Afifi-Sabet Produces Useful, Informative Coverage Regarding Privacy
And it's good for Richard Stallman
Confirmed: Microsoft Layoffs in August 2026, Entire Operations Shut Down Too
Microsoft is just bleeding
Paying With Cash in 2026
Cash isn't going away. Not any time soon.
Blocking Tor Is Not a Solution, It's Paranoia
Tor is not a crime
Oligarchs and Their Footsoldiers Are Most Enthusiastically Loud About the Things They're Attacking
Like "Microsoft loves Linux"
FOSSY (SFC) Platforming GAFAM, Sells Endorsement
Houston, we have a problem here
Not Allowing Misogyny and Misogynists to Run the World
We stand with (and for) equality, justice, and freedom
"SPONSORED EXPLAINER" at The Register MS is Just More SPAM "Sponsored by HPE."
This is a great example of crap 'journalism'
IBM Won't Hire (or Hardly Hire) This Year
IBM is bluffing with buzzwords while shrinking out of existence and reducing salaries
SLAPP Censorship - Part 146 Out of 200: An Industry of Plagiarism, 'Normalised'
they pursue personal enrichment by stealing from Free software developers
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, August 10, 2026
IRC logs for Monday, August 10, 2026
5.1k Capsules Known to Lupa, Gemini Protocol Crawler
If no limits (e.g. 10k max per capsule) were imposed on crawling, there would likely be millions of pages in the database
Gemini Links 11/08/2026: Waking Up Earlier, Whining About LLMs as Destructive Plagiarism
Links for the day
Links 11/08/2026: "The Enemy Is the Platform" and 'Vibe' 'Coding' Shown to be Little But Plagiarism
Links for the day
IBM's Age Discrimination Leads Workers to Contemplate Suicide While the CEO Becomes Billionaire for Lying to the Press and Faking Performance (Fraudulent Accounting)
IBM avoids issuing WARM notices
If Your Software Project Welcomes Bots, Then All You'll Have Left at the End Is Bots (Same for Sites Which Permit LLM Slop; They End up as Slopfarms and No Human Wants to Contribute Anymore)
A "slippery slop."
Clownflare Affirms Disturbing Trend of Web Monoculture (Which Extents to Clownflare Itself)
Clownflare itself is another layer of the same problem
The Open Web Is Not Coming Back
the open Web going out of control
Tell Me Something I Don't Know
Those who have a stake in the secrecy would do anything to maintain secrecy
Gemini Links 10/08/2026: Recollections and Washing Machine That Only Last a Few Years
Links for the day
Claims of Mass Layoffs at IBM (in Finance)
IBM tries hard to maintain an illusion of normality - to the point of viciously censoring critics and whistleblowers.
The Slop Bubble (Pyramid Scheme) is Becoming Bigger and Everyone Should be Terrified (Its Implosion Will Cause More Damage)
there's no plan for a turnaround
Microsoft and Apple Lose Ground to GNU/Linux in the United States
This contributes a lot to the international curve
Escaping Ads
When users do not want ads, then no ads should show up, period
For Second Year in a Row Software Freedom Conservancy (SFC) Loses Money (Over $3,000,000 Lost in 2 Years), Bradley M Kuhn Steps Down as Treasurer
lost almost $600,000 last year
Microsoft/GAFAM Operating at a Loss
Microsoft has financial problems
Nigel Farage crisis: Taylor Swift & Jeffrey Epstein both shunned cryptocurrency bosses
Reprinted with permission from Daniel Pocock
statCounter Now Sees GNU/Linux "Market Share Worldwide" at 9.21%, Soon 10%
If this data is more or less accurate, it's time for panic at Microsoft
Rumours of Impending Mass Layoffs in IBM's Yorktown Office, Impacting the LLM (Slop) Staff
Bubbles never last forever, hence their name
Links 10/08/2026: "Long COVID Linked to Lasting Damage in The Brain's Dopamine System", Microsoft’s Weather App Uses Over 1,000 Megabytes of RAM
Links for the day
Software Freedom Conservancy (SFC) Does Not Support Women, It Imitates Authentic Organisations, Embraces Misogynists, Then Projects
They try to monetise for personal gain at the expense of unpaid volunteers
When You're Evil and You're Publicly Attacking Something, That Something Will Become More Popular
when an oppressor becomes openly oppressive and does anything to squash/censor critics, the outcome will typically be detrimental to the oppressor
Links 10/08/2026: "Against Oligarch" and "The Invisible Women"
Links for the day
Social Control Media Deathwatch: After Nearly a Million Posts Sent EchoFeed Shuts Down
EchoFeed is hardly unique
When the LLM Chatbots Industry (Trillions in the Red) Quits Paying the Media for FOMO
fear of missing out, or FOMO for short
Microsoft Killing Morale
branding the process “inhumane” and “demoralizing”
Google's "AI Overview" as Proprietary Censorship Engine and Gatekeeper
People do not choose to use this, Google is just shoving that in people's faces, encouraging laziness and misinformation
SLAPP Censorship - Part 145 Out of 200: They Tried Hard to Hide the Fact Their Client Had Been Sued, Twice Even
A month ago Brett Wilson LLP tried to take my wife "to the side" (in effect isolated) to make her an offer
statCounter: GNU/Linux Up to 8.95% Globally
So the estimates are being "corrected" upwards, not downwards
Explaining How Someone Attempted to Cancel RMS This Year (and Failed)
The process itself involved debunking some falsehoods
Microsoft's "XBOX Ranks Last", IBM is Headed for Extinction
If Microsoft cannot dominate its own "home turf", what prospects are there elsewhere?
DebConf6 fight denied by Google artificial intelligence
Reprinted with permission from Daniel Pocock
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, August 09, 2026
IRC logs for Sunday, August 09, 2026
Gemini Links 10/08/2026: A Mild Monday, Sleepy Saturday, OUYA, and Moving to GNU/Linux
Links for the day