When I say that I am a programmer, I immediately see the same thing. They look away, smile politely, try to change the subject. In case of luck, I will receive a proposal for another killer application, or I have no luck and everything ends with another dispute. But the fact is that programming is much more interesting than many people think. For example, the genre of video games is also related to this branch of science.
But can these games teach us such a science? Is it possible to become a programmer through the gaming space? I found three different educational games on Steam. Let’s take a look at them and see if they can teach you?
It is clear that there are few such games in which you can learn how to write code in C #, but here programming ideas turn into visual comparisons and achievable puzzles. Therefore, we will consider these games as a theory of programming in order to teach you how to convert the game system into program codes. We will also play these games in ascending order of difficulty to make it easier to grasp this science.
It should also be emphasized before we begin that this is only our opinion on the possibility of learning through such games. Forward!
Human Resource Machine (Personnel Machine).
Difficulty: Beginner – Intermediate
Human Resource Machine is all about data processing. A conveyor belt labeled “B” delivers tiles with numbers and letters printed on them and you must send the correct ones as described for each task to a conveyor labeled “OUT.” To do this, you draw up a command plan for your employee to follow – a program, essentially. Since the alternation of tiles is not the same, your system must consider all possible combinations of numbers and letters. This is a problem that all programmers are familiar with.
CM does a great job of introducing concepts in an accessible way, giving you time to familiarize yourself with each new command before moving on to the next. What’s more, you can slow down the time the worker is executing your program by stepping over each command to see exactly where and why it doesn’t work as you expected. Given the amount of time a programmer spends debugging, it’s easier to figure out what to do with that kind of practical workload.
However, affordability and ease are only part of the programming equation. The fundamental question is: can a CT game teach you how to program? To answer this question, let’s dig a little deeper in terms of solving the CM puzzle.
Concept: basic variables.
What it is?
Dealing with unknown data, be it a conveyor belt with random numbers or letters or commands from the light keyboard from Starcraft Pro, is a core component of almost any program you write. Since programs cannot predict the future, they still need a generic placeholder to store and access unknown data at runtime. This is where the variables come in. A variable is a labeled container for data that can be emptied and replenished as needed.
How is it taught?
In CM, floor tiles serve as a substitute for variables. In the center of each puzzle room, the floor is divided into numbered grids, where numbers and letters can be temporarily stored on the conveyor belt. In the command list, you notice the numeric labels of these tiles – starting at 0, because in programming the counting always starts at 0, not 1. Alternatively, you can give them your own labels, like “FirstAdder” or “Tully “, it will help make your program simpler. This is a very important technique in programming, especially if several people are working on the same code. Well-learned variables will help you understand immediately where the failure occurred, instead of chaotic memories of what your code is doing.
Concept: Arrays.
Who are they?
If variables are used to refer to a single value or object, arrays are used when you need to group a whole bunch of similar objects together. Instead of having to code for each slot, you can code for the entire inventory. The advantage of doing this is that such items can be referenced in relation to the inventory object as follows: inventory [0], inventory [1], inventory [2] … This makes it very easy to write code that checks all slots in the player’s inventory, and in terms of raw performance, arrays are much faster than individual variables.
How is it taught?
CM doesn’t strike with its implementation of arrays. Rather than referring to tiles directly through their labels, you can use the value within one tile as a label pointing to another. For example, a tile with the number ‘0’ might have the number 7 in it. For example, using the normal copyfrom ‘0’ command, you will get it back. If you use copyfrom [0] instead, the program will use 7 as another label and get the value inside Tile 7. Don’t be surprised if you don’t understand how this program works, it will only be clear when you see it in action. It is important to note that CM allows you to do this with several puzzles.
Concepts: Conditional Operators (also known as definitions)
Who are they?
The program will not be useful if it will return the same, regardless of the data you specified. It will be like a game that plays itself, ignoring all input from the player and repeating the same loop over and over. Programs must make decisions, whether it is simply deciding which of the two numbers is greater, or determining whether the crossbow will hit the player. Conditional statements are the heart of the program, the artificial equivalent of our program.
How are they taught?
To keep things simple, CM includes only two types of operators: jump is zero, and jump if negative. These commands test the value in the hands of your worker and jump to another part of your program if the condition is true. If your worker holds -5, the jump if negative command will resolve as correct and will follow the jump arrow to the part of the program you pointed it to. If your worker is holding 1 instead, the program will continue as usual for the next command on the line. It might sound pretty straightforward, but later puzzles require a bunch of jump if commands, all working together, their jumping arrows crisscrossing like a football game designed by the devil himself.
Concept: Iteration (called looping)
What is it?
Repetition is the basis of computation. We create programs to automate tasks that we don’t want to waste time on, they are called loops. Cyclically moves flocks of NPCs back and forth along the same patrol route. Loops strike enemies with fire damage every second they burn. The hinges keep the vehicle accelerating until it reaches its maximum speed Hand-coding every step of these processes would be extremely inefficient, and when it comes to programming, inefficiency is a sin.
How is it taught?
CM combines the aforementioned conditionals with a standard branch instruction to convey the basics of looping. There are two main types of loops, “for loops” and “while” loops, and CT teaches both. For hinges that execute a set of commands a specific number of times, using one floor tile as the counter, pulling the pliers down until it meets the jump test if zero and “breaks” out of the loop. While loops function in much the same way, except instead of looping a set number of times, they keep repeating while some condition is true. As the puzzles get more difficult to get, you need to combine both types of loops with tiles of arrays to process lists of data of unknown length.
Conclusion:
By creating the concept of familiar items such as conveyor belts and floor tiles, and offering only a small list of commands to operate, the HR Machine serves as a solid introduction to basic programming principles. Color-coded commands and helpful navigation arrows reflect flowchart language, making it easy to keep track of what a program does as it runs. Custom terminology like copyfrom and bump may not translate 1: 1 into modern programming languages, but the ideas they teach are the same. Once you have mastered CT, you will be well prepared to start learning how to write code for real.
Hack ‘n’ Slash (Ruby and Slash).
Difficulty: medium – advanced
Maybe you want to prepare a little more before diving into the world of programming. This is where Hack ‘n’ Slash comes into play . At first glance, this appears to be a typical Zelda-style game adventure game, but instead of knocking out enemies, you slash them using your USB sword to reprogram their behavior. Almost all objects in the world can be reprogrammed this way, up to the point where you can actually force the game to crash by rewriting your code. This applies to both the benefits of the game and its damage; On the one hand, this opens up a huge scope for imagination, and on the other hand, you can only make things worse, not knowing what you are doing. But this way you can describe the principle of programming more simply for the uninitiated person.
The main problem with Hack ‘n’ Slash is that they are actually two different games, one is a Zelda-style puzzle exploring concepts like variables and subroutines in greater depth than the Human Resources Engine, and the other is a complete code debugger. which takes you to source code without a floating board. This tricky jump makes Ruby and Cut a rough game, but if you can skip it, there is a lot to explore here.
Concept: Extended Variables
Who are they?
As mentioned earlier, variables are ways of storing data in a program. In Ruby and Cut they are needed for storage much more than the single letters and numbers in the Personnel Machine, and their role in determining the behavior of a program becomes much clearer.
How do they teach?
Ruby and Cut develops the concept of variables by introducing so-called “typed” variables. These are variables that contain only one kind, for example “true” or “false”. When you hack an enemy, a list of variables that you can encounter pops up, but here you can only change the values: you cannot store letters in numerical terms, or increase the number outside certain limits. As a result of following these unshakable rules, you will gradually learn the difference between logical integers, integers and strings, even if you encounter them for the first time.
However, the essence of the lesson about variables is how their values determine the behavior of the program. The trial and error path through the range of a variable is good mental practice for the programmer, especially when testing and debugging. The program must be able to handle all possible data thrown into it, even if that means rejecting data that would make it funky. Realizing that you can easily hack your enemy of this game by setting their damage variable to -1 serves as an invaluable lesson in the importance of testing correctly.
Concept: syntax
What is it?
Any language has rules for constructing words and sentences, programming languages have the same rules for combining words into sentences. This grammar is known as syntax, and although it is different for each language, most of the programming languages of our time follow the rules established about four decades ago.
How is it taught?
Ruby and Cut introduces the syntax system in the second part when it encounters bare code. Based on the Lua programming language, the code has a number of privileges with its syntax to make it easier to understand. In practice, fictional terminology only trades one kind of confusion for another, limiting its real value in the process. Fortunately, the most common syntax elements remain intact, introducing you to the general look of modern code.
These grammar rules include the dot syntax, used in terms of the type Port.Value, which refers to the Value variable of the Port object, and the structure of the if … when statements to make decisions. To help you decipher these often misleading rules, Ruby and Cut takes you into a parallel version of your code, where variables are fed in as colored crystals that enter machines and process them in action. The colored lines trace the flow of the program between the machines, but the locations of these machines are very close to each other and are a little more difficult to understand.
Concept: Functions / Methods
Who are they?
There is an old proverb in programming, 90% of a program’s time is spent executing 10% of the code. The program spends a lot of time repeating the same actions. To take advantage of this, we split the most common code into individual values, and whenever a program needs to run that code, we simply call the individual value using the fun Function command. It saves us from rewriting the same code multiple times throughout the program, and more importantly, it means we only need to change one piece of code if a frequently used function needs to be improved.
How is it taught?
Taking the form of the largest machines in the rendered version of the code, the functions themselves can be hacked like enemies and other objects, making the ESC script dive into the code within the code. Changes made to the function code will be distributed throughout the game, which could potentially lead to unforeseen consequences in the future. This danger is common in large-scale projects, and learning to closely monitor all minor deviations is also a very good practice for understanding programming.
Outcome:
As a game, Ruby and Cut has many problems. As a programming tutorial, it’s noticeably better. By highlighting the impact of variable fitting and portraying functions as physical machines, he encompasses insights that are invaluable to all aspiring programmers. As long as you’re willing to study hard how much trial, error, and frustration goes into coding, you can grasp the rules and construction of the various processes that underlie all languages of the modern era.
TIS-100
Difficulty: Advanced +
The first thing you hear when starting TIS-100 is a cold boot of the old MDG. Whether it’s nostalgic or not, this is a good litmus test of how you would feel about an assembler compiler disguised as a game. Make no mistake: TIS-100 is designed for the most demanding programmers. If you are not already familiar with conditional statements, iterations, etc., a steep learning curve will appear in front of you. In principle, the TIS-100 is an order of magnitude more complicated than the first two examples.
Assembly language for the uninitiated is a form of programming language that was prevalent in the 50s and 60s and then supplanted by higher-level languages such as C in the 70s and beyond. Assembly language instructions are usually based on the machine code that the computer uses to communicate with itself, and are therefore significantly more difficult to read and write compared to the likes of Java and C #. Nevertheless, despite its ancient sensibility, the TIS-100 copes with a number of concepts that remain relevant to this day.
Concepts: Communication
What is it?
Communication is an essential part of modern programming. From online leaders to multiplayer FPSS to MMOs, games are increasingly communicating with each other in order to make the gameplay more interesting. It is more difficult for the program to work here because it cannot predict what a living person will do. To fix this, programs communicate using ports and connectors that underlie the operating system-controlled mailboxes. The program can send its data, while the recipient will already check for new messages.
How to teach it?
Programs in the TIS-100 are divided into nodes, each of them can make only a limited number of instructions. Achieving goals requires a lot of communication between nodes. Even worse, each node can only communicate with a certain number of users, complicating the situation even more. The creation of workers requires the definition of each node separately, secret only for their own operations. Getting them all in order to cooperate not with one object, but with many, as every good programmer should be able to do. You will very quickly find that it is much more difficult to combine several different programs at once than it seems at first.
Concept: Stack
What is it?
Like arrays, a stack is a container for grouping related data. The stack is, however, more important for shared values, where different programs or different parts of a program need to access the same data without being directly linked to each other. As the name suggests, the stack stores data in a vertical list, following an end-to-top protocol: when a new item is added, it goes to the top of the list, and when an item is removed, everything goes from the beginning of the list. Think of it like a stack of plates at a buffet restaurant where patrons take over and clean dishes are also placed at the top. Or the back button in your internet browser and its record of your recent page history.
How is it taught?
As the programs you write increase in complexity, moving data between nodes that can only store two things at a time becomes a game of Chinese whispers, and the likelihood of error only increases. Implementing stack nodes with their unlimited datasets gives you the means to handle much larger datasets, although no additional capacity is freed up. You should consider issues such as deadlocks, where one node is waiting for an empty stack to pop up, but the node that pops it up is in turn waiting for something from the original node – stalemate! Then there is a problem of keeping all data in one stack without mixing them. Weighing the tradeoffs of stack node usage versus manual data management is the type of consideration that programmers do on a regular basis.
Verdict:
Although the TIS-100 looks like a relic of the past, it is in no way obsolete. From menu overlay to multi-core programming, concepts like memory stack and network ports are more relevant than ever. For a programmer while learning, this game is the last obstacle on the way to mastering this science. You can learn the principle of TIS-100 coding, in the future it will be easier with more serious projects.



