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, Running Out of Things It Can Sell, is Selling Software Patents
IBM is not just pathetic; it's actively harmful because it lobbies for software patents and spreads software patents around
The 'Church' of Moglen/Stallman
'reunion' with Eben Moglen
Microsoft Has Fallen to #3 in Singapore
There are many technically talented people in Singapore or overseas workers who lodge in Singapore
 
As Expected, Facebook Collapses, Microsoft Hides Massive Debt
GAFAM is a giant mountain of debt
At The Register MS "PARTNER CONTENT" Means Company Writing Fake Articles About Itself and Its Own Products
At The Register MS, content-farming has become a thing
Staff of EPO Cautions Against Unlawful Weaponisation of PIPs Against Industrial Actions That Protest Corruption
PIP-like sanctions against anybody who does not toe the line of Cocaine King?
Gemini Links 29/07/2026: Star Trek, Retirement, and ODEs in GNU Octave
Links for the day
Links 29/07/2026: "BuzzFeed Lays Off 33 Percent of Remaining Staff" (Trying LLM Slop Some More), Scam Altman Mocked by the Media
Links for the day
GNOME Curated and Censored by IBM (Under the Guise of "Code of Conduct")
Felipe Borges (IBM) has just posted a follow-up
Digital Mass Surveillance as a Hallmark of Failed Societies
"small leap forward in tech ethics"
I Found a Typo, Don't Vote!
Social control media isn't good at adding any meaningful signal
Jeremy Sands Explained the Harms of Codes of Conduct
next week the 500th show milestone [is reached]
Tonight's Earnings Report From Microsoft and Facebook ('Meta') Will be Faked Because They Hide Almost a Trillion Dollars in Debt
The US economic system is only as honest as the people who govern it
The Vacuum Syndrome
Parables help
The Only Old People Who Can Survive IBM Are the CEO and His Circle of Enablers
very similar to what's happening at the EPO
Microsoft Layoffs Aren't Done Ahead of the Need to Tell Shareholders About "Efficiency" (Tonight)
Microsoft layoffs won't be "Done" until what's left of Microsoft is "None"
Microsoft Lacks Growth. Ahead of 'Results' The UK's Competition and Markets Authority (CMA) Finds Merit in Allegations Slop is Microsoft's Excuse for Price Hikes (Piggybacking Vendor Lock-in).
At this stage it's not hard to see why many nations gravitate away from Microsoft
Parliament leaks confidential cult inquiry witness contact list (COFG Victoria)
Reprinted with permission from Daniel Pocock
Troll-Feeding is Time-Wasting
in social control media
WordPress is Technical Debt
There are a number of technical tasks underway and maybe some testing (this coming weekend or later)
Will Red Hat Still Exist in 2027 or Just Become a "Brand" at IBM?
Whistleblowers told us IBM was laying off about 500 Red Hat engineers earlier this year
Call for IBM Whistleblowers
If you work for IBM and have something material (like balance sheets) to prove financial misconduct, please try to 'touch base' and establish a secure communication channel we can both use
EPO Series on EU and Pan-European Corruption, Vote-Rigging, Extending Beyond the EPO Itself
By Saturday it will be August already, so we'll start preparing for Rianne's birthday
SLAPP Censorship - Part 133 Out of 200: Lies by Omission
As usual, the other side wants people to ignore how much they lost
European Patent Office (EPO) Series: Streamlining the Decision-Making Process
Negrão was one of 17 applicants for the position but he somehow managed to end up as the sole candidate on the shortlist prepared by the Management Board in June 2020
Links 29/07/2026: "Hugging Face Has a Deepfake Nudes Problem" and "$1.5B Anthropic Copyright Infringement Ruling" (Plagiarism is Not "Training")
Links for the day
Comments on Today's Judgment
It hopefully helps clarify what actually happened
Thank You, Andy
Burnham and "Tech Rights"
Solicitors Regulation Authority (SRA) Inaction and Incompetence - Part II - 77 Messages Sent, Did Not Even Investigate or Examine Any of the Actual Evidence (British Taxpayers' Money Wasted)
SRA has become known (even notorious) for inaction
Inevitable Politics
In technology, provided the work you do has growing impact (we served almost 2 million requests yesterday), things will inevitably become more political - whether you like it or not does not matter
Not Only "Loonies Take on Farage"
pretending that the opposition to the right wing is "Loonies"
Brigading Against Women - Part I - Bypassing the Legal System by Threatening Companies in Another Continent
In the next part we'll begin to connect Lozza's online activities (and court activities) to those of Garrett
IBM is Trying to Turn Debt (Borrowed Money) Into Fake Growth and It'll Worsen Matters
they put in their balance sheets a fake "growth" in something that does not even exist
Microsoft Relies on Misleading Narrative of Studios Going 'Independent'; in Reality There Are Mass Layoffs in Them
This is not a good narrative for Microsoft
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, July 28, 2026
IRC logs for Tuesday, July 28, 2026
Gemini Links 29/07/2026: Arosa, Tired Tuesday, and Constellation Browser
Links for the day
In IBM, PIPs and RAs (Layoffs) Have Become Almost the Same Thing, Workers 'Expire' With Age (Seniority, Experience) and Empathy is Punishable by Termination
IBM does seem like a dead company
At Microsoft, PIPs Are Sometimes Known as "LITE" (a Silent Layoffs Legal Hack or a Shrewd Workaround to Skirt WARN Act)
Zero "layoffs" to report
Gemini Links 28/07/2026: “Strategies Against Algorithms” and DIYers
Links for the day
"Social Dialogue" With the Man Who Never Faced Real Competition at the European Patent Office (EPO), He Buys the Voters and Eliminates Rivals
Will the "Pretender" write back?
Digital Restrictions (DRM) and Microsoft: What Kills XBox Will Kill Windows Next
Microsoft wrongly and very arrogantly assumed that users would tolerate everything it throws their way
GNU/Linux in Afghanistan Reaches 7%
For many years it was stuck at less than 1%
Greenwashing Corruption With a "Chief Sustainability Officer", Who Infamously Defended Battisetelli's Crimes at the EPO and Petitioned for Him
She was rewarded for conspiring against EPO staff, as usual
What I Explained to Police About Blackmail and Death Threats via Burner Accounts (a Practice Which Generally Constitutes a Crime)
Today I've communicated several times with police
Links 28/07/2026: "People’s Claude Chats Are Publicly Accessible Online" and SpaceX Stock Crashes Like Its Products
Links for the day
UK tech sector missing from democratic process
Reprinted with permission from Daniel Pocock
How Not to Cover Elections (Democracy Relies on Reliable, Complete Information)
Misinformed voters are a recipe for disaster
Microsoft E.E.E. (and "Bait and Switch") Going Exactly According to Plan
That is what they are trying to tell us and the companies that employ us
IBM: An Old Company That Hates Old People
Remember that's coming to Red Hat workers in 2 months
Strict Policy on Violence and Violent Language
This matter is now being escalated to law firms
Avoiding Discrimination Against People With Disabilities
work underway to improve the system which runs the sites
Links 28/07/2026: XBox DRM Doomed Everyone (Cannot Play Anything), Slop (Ponzi Scheme) Being Pinkwashed Now
Links for the day
Gemini Links 28/07/2026: Ethics, GIMP Script-Fu, SMTP Versus Gemini, and Proposal for Better TOFU
Links for the day
To a Sociopath, Ethical People Are Bad People. Don't Fall for It.
If you put sociopaths on a pedestal, the pedestal will break
Improving the Static Site Generator
Our system has fixes triaged
Diversity in Debian
bringing up the topic is the real problem, diversity itself is a taboo subject
GNU/Linux in Brazil. The B in BRIC(S).
the "market share" is assessed to be around 5%
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, July 27, 2026
IRC logs for Monday, July 27, 2026
Hate Consumes the Haters
If you hate someone (or something) and you're willing to do anything for "hate rituals", then at the end the emotion will outweigh reason and it'll backfire, surely
GNU/Linux Rises Some More Internationally, statCounter Now Estimates Its Usage on Desktops/Laptops at 7.7%
significant growth for GNU/Linux in Japan, China, Thailand, Vietnam, Indonesia and Cambodia
IBMers on PIPs and the Age (or Cost) Factor
People in their 50s seem to be targeted as they are considered "expensive"
Sad State of Troll-Feeding British Media (Establishment Channels Promoting Total Idiots)
Breeding ignorance means people will assume they have a choice between two pieces of trash: "Nige" or a literal trash can
Links 27/07/2026: Sleepless Japan PM Takaichi Becomes Unpopular and Data Centre Magnate Confiscate Land Without Consent
Links for the day
A Few Hours Ago The Register MS Published an 'Article' With "AI" 32 Times in It, Including First Word in Headline and Summary. It Was Paid SPAM "Sponsored by Hammerspace".
The lost media is engaging in self-harm
Microsoft is Down
This relates in a timely fashion to what we published yesterday
In Techrights, Gemini and HTTP/HTML Are Very Different
Those were never equivalents or mirrors, those are two things that are inherently different and are maintained by different teams
Gemini Links 27/07/2026: Gemified Internet RFCs, “Junk DNA” Is Commented-Out Code, and More
Links for the day
The Techrights Gemini Capsule Was Never a Mirror
Techrights has long taken accessibility quite seriously
Americans Are Not Our Masters
If you are subjected to online abuse, don't give up
Daniel Pocock Campaigns Around "Safety of Children Online" and "Cybersecurity"
There seems to be a growing 'coalition' in the UK based around important issues which impact the entire planet
XBox the Console is Practically Finished (Unofficially), Even the Streaming ("Live") or DRM Service is Dead
XBox has never been closer to profitability
Many CEOs Are Just Glorified Scammers With Suits and Ties
Economies cannot function when few people abuse them for self-enrichment
After statCounter Figures Out Many "Unknowns" Were in Fact GNU/Linux the "Market Share" Estimate in China More Than Doubles
Japan is the same for similar reasons
peppe8o - a Site About Raspberry Pi, Arduino and Electronics - Has Turned Into a Slopfarm
We won't be linking to it anymore
Feeding 'the Children'
Maybe some time soon we'll do a fund-raiser to help feed the birds
Japan: GNU/Linux Crosses the 5% Threshold, Two Years Ago It Was Only 1%
Now it's at over 5%
We Need More Transparency
Our heads of state are very much aware of and concerned about SLAPPs and censorship
"The War on Children" Explained by The Cyber Show
Consumer protection and the war on children
EPO Cocainegate and Current EPO/EU Series to Carry on for Months to Come
Another week has begun
When IBM "Managers Have to Mark 15% of Their Teams as Low Performers" a PIP Means Likely Layoffs (Disguised as a Performance Issue)
"IBM is a Law firm with an I/T department."
Links 27/07/2026: Chatbots Lead to Suicides, Social Control Media Intentionally Designed for Addiction
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, July 26, 2026
IRC logs for Sunday, July 26, 2026