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

Links 05/11/2026: Rule of Law Vanishing in Turkey, Joshua Wong Still Martyred by Chinese Regime
Links for the day
Gemini Links 05/11/2026: Classical Music, Politics, and Seeed Studio
Links for the day
Like Almost Every Slopfarm, UbuntuBuzz Seems to Have Thrown in the Towel
Linuxsecurity and Linuxiac (to some extent Linuxjournal) are still going, but for how much longer?
EPO 'Midterm' Elections Should Oust the Dictator
Tentatively a failure to secure another (unprecedented) reappointment before Christmas
Secret IBM Layoffs and Increase in PIPs (Silent Layoffs)
The media is failing to do its job
Links 05/11/2026: "Voice is Underutilized" and How Data Centres Lost the Midterm Elections
Links for the day
Intercontinental Brigading - Part XXXIX - Crime Numbers Regarding GGG (Americans) and Why Those Still Matter
Time does not undo the actions
Intercontinental Brigading - Part XXXVIII - Telling the Police About the Defamatory Blog Where Posts Targeted My Wife and I (From Across the Atlantic Ocean)
Two years ago we spoke to cops a lot
The Register MS is Losing Money Again, Based on The Register MS
Selling out didn't pay off for very long
There Are No "Layoffs" Anymore, Layoffs Got Rebranded
We're entering bizarre times when layoffs are said to be "down" (according to the regime that suffered a 'bloodbath' in the election) because companies quit using the term "layoffs"
Gemini Links 05/11/2026: Rivers of London, Soul Cakes, STMicroelectronics, and Slop
Links for the day
The Register MS Has Just Published Fake Article With "AI" 84 Times in the Page Because It Was Paid to Do This!
Astounding number of mentions of "AI" (84 in total)
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, November 04, 2026
IRC logs for Wednesday, November 04, 2026
Links 04/11/2026: Slop Helps Break Laws and Scam Altman Pretends Chatbots Are Persons
Links for the day
Gemini Links 04/11/2026: Abacus and Spare IT Equipment
Links for the day
Viet Nam and Thailand at High Adoption Levels of GNU/Linux, Other Nations Nearby Are No Exception
Helen Chiang and her colleagues say it's a "clown show" at Microsoft
Richard Stallman on What It's Like to be Threatened by Strangers With Software Patents
We hope that some EPO insiders will take time to listen to this talk
Intercontinental Brigading - Part XXXVII - Tasteless, Tactless Time for "Virtue-Signalling" (When Your Actions Are Much Like the GOP's)
Violence by cops isn't a "leftist" thing
Stealth Layoffs at IBM (PIPs and Bailouts)
string of reports or unverified hearsay
United Arab Emirates: GNU/Linux at Over 8%
According to statCounter
As XBox Goes Out of Business Helen Chiang Adds Insult to Injury
XBox sales are worst in 25 years
Steven Vaughan-Nichols is Slop
Just look at this
The Register MS is "Hosting a Dinner" for Sponsors
Remember that The Register MS keeps publishing spam about "AI"
Intercontinental Brigading - Part XXXVI - A Potent Microsoft Threat to Administration of Justice Globally (Not Just Fair Elections)
Breaking into machines to cover up one's own crimes
Intercontinental Brigading - Part XXXV - When One Does Not Understand Security (Nor Ever Pursues Security)
One might therefore conclude that Garrett is a proponent of American back doors
Links 04/11/2026: "Democratic Establishment" Wins Big and "Pentagon Sued Over Hegseth’s New “Future of Warfare” Committee Led by Musk"
Links for the day
Intercontinental Brigading - Part XXXIV - Women as Hostages, Even Spouses
First he put his own spouse behind bars by accusing the spouse of what he himself seems guilty of
A Geminispace Tally
That's not the Web, it is an alternative to it
Intercontinental Brigading - Part XXXIII - Shooting the Messenger is a Presidential Tactic
why our ministers are looking for ways to fix the law.
Andy's Latest Writings About Proton CEO Andy Yen, "JavaScript Required", and Slavery in Technology
Andy (of The Cyber Show) has some new material
Intercontinental Brigading - Part XXXII - Malfunctions Reported in Windows Voting Machines (as Usual)
"There are always problems," Ryan told us
Gemini Links 04/11/2026: GoAccess, Adopting Gopher, and Twisty Passages
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, November 03, 2026
IRC logs for Tuesday, November 03, 2026
"The Judge Accepted That Mrs Schestowitz Had Been the Subject of a Vicious Campaign of Online Harassment"
That's consistent with how they men treat women
Intercontinental Brigading - Part XXXI - Microsoft and Promoters of "Secure Boot" Are to Blame
the important thing is that the dictator and Microsoft can remotely control all computers
Links 03/11/2026: Science Around "Near-Death Experiences" and "Do Animals Grieve?"
Links for the day
Gemini Links 03/11/2026: Guitar, 3D-Printable Electric Spinning Wheel, Against Haven Social, and More
Links for the day
Intel Corporation Down Over 51% in One Month, the US Bailout Didn't Work
Is the slop industry [sic] next?
Microsoft European Development Centre (EDC) Next to be Culled?
No time for that anymore
Intercontinental Brigading - Part XXX - Breaking This Year’s Election Process With Bug Doors in Restricted Boot
Thankfully here in the UK we typically still vote with paper and pencil
Mass Layoffs at SUSE, Over 10% of Staff Gone
Ignore their excuses
When You're a Software Developer and They Tell You That Your Occupation is Dead or Dying in Order to Sell Dysfunctional Offerings Based on Hype (and Plagiarism)
Disbelief is a strength when companies borrow trillions of dollars to sell a dud and construct a pyramid scheme
Links 03/11/2026: Slop-Tied Debt is Becoming a Crisis (Lenders Panic), "Ukrainian Journalists Urge Global Media Not to Look Away From Russian Aggression"
Links for the day
Malaysia Seems to be Exploring Digital Independence With GNU/Linux and More
not too bad
Microsoft Windows is Crashing in Republic of South Korea
Like in Japan, they seem to be shutting the lid on decades of Microsoft-isms
Think Less, Aim for Less (When It Comes to Hardware)
An abundance of hardware being wasted on a pyramid scheme will become a cautionary tale one day
Gemini Links 03/11/2026: Stargazing, Linux-Powered Prism "Ambient Computer", and Abandoning Streaming Disservices
Links for the day
GNU/Linux Made Big Strides in Portugal This Year
Microsoft had many layoffs in Portugal in recent years
GNU/Linux in Argentina Now Measured at 8% "Market Share"
Argentina is known for exporting skilled footballers, not advanced technology, but it has a large population, which we can hope will dump Windows
Microsoft is Borrowing Loads of Money While Telling 60,000 Workers to Take the "Offer" and Leave, Microsoft Wants Bailouts From the Dictator
Vote in elections and also vote with your wallet
Microsoft and Spoilt Food
Some whistleblowers may be needed here
Intercontinental Brigading - Part XXIX - Undermining US Election While Engaging in Lawfare in England (BBC) Against Publishers That Cover Anti-Election Violence
The elephant in the room is back doors in voting machines
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, November 02, 2026
IRC logs for Monday, November 02, 2026