Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Which programming games helped you become a better programmer?
84 points by gpa on June 5, 2022 | hide | past | favorite | 85 comments
There are numerous programming games available that claim to teach you how to code. However, I couldn't find any posts on HN that confirmed or denied their usefulness. Except this one, but it's from 5 years ago: https://news.ycombinator.com/item?id=13566247

1. Are there any good beginner programming games in widely used programming languages (like C, C++, C#, Java, JavaScript, Python, PHP)?

2. Are there any programming games that have helped you become a more advanced programmer (or a better programmer)?

I am interested in games that are not just fun, but also teach you programming useful in the real world (maybe not directly, since it's a game, but still).




Well, I've enjoyed these games as for fun, but they did provide an intellectual challenge: TIS-100 https://store.steampowered.com/app/370360/TIS100/ SHENZEN I/O https://store.steampowered.com/app/504210/SHENZHEN_IO/ Hacknet https://store.steampowered.com/app/365450/Hacknet/ Uplink https://store.steampowered.com/app/1510/Uplink/

As for becoming a better programmer, it's all about practice. CodeWars might be what you're looking for: https://www.codewars.com/


> all about practice

and communication, and writing simple readable code

for a lot of programmers solving "tricky" algorithmic questions are more the exception then the norm

In turn while it's a must have skill for senior programmers for mid level programmers improving skills around communication, writing simple easy to read and understand code often is much more useful.

Edit: and being able to abstract properly/see beyond the marketing (especially for web).


Codewars is a poor recommendation for becoming a better programmer, the solutions are sorted by popularity and so generally "cool" solutions are at the top. I've yet to see a clear/good python solution anywhere near the top.

I suppose you could just do the tasks and ignore the website itself.


second this!


Maybe not an exact answer to the question being asked, but when flexbox was first introduced a few years back, I remember being quite overwhelmed by it, but the game that helped me "grok" it was Flexbox Froggy: https://flexboxfroggy.com/

Even now, when I am working with frontend designs, I sometimes am mentally picturing my elements as frogs that need to be placed in the right place :D


+1 for Flexbox Froggy, and I’d also recommend the sibling game for css grid, https://cssgridgarden.com/


I learned flexbox from a game too! I think it was Flexbox Tower Defense.


Factorio.

Factorio doesn’t exactly have code. However, it’s very much a game about systems, and how to efficiently build and manage them.

In fact, Shopify expensed the game for their employees [1]

1: https://twitter.com/tobi/status/1294330081452666882


I had a revelation when I realised the problems I had when building a base in Factorio were basically the same I had when programming, just visualised in a more intuitive way.

Translating the solutions of my Factorio problems into my real world problems worked like a charm.


Whenever I play this, for days afterwards I’m in a state of mind looking for anything in my life to automate.


I think of Factorio as a circuit board designing game more than programming. Still fun as heck though.


Dunno, I think it captures several of the skills needed in programming, not the actual writing code, but both refactoring and optimization are translated fairly accurately.


Meh, lol. From my spaghetti factory you would never have guessed i was a software dev by day.


That's exploratory programming for you.


If you're willing to be charitible of where exactly programming comes in while playing a game - I would say creating cheats or bots for video games.

These days, you will most likely have your account restricted and banned from an entire ecosystem of games if you try this, but back in the days where flash was dominant you could do lots of fun things with little risk. Many fun times in Runescape making dollars off my bots that ran air runecrafting bots, or Fist of Guthix bots in F2P and selling the GP I got for the rewards. Does not need to be very complicated either IMO.

For a direct answer, I think Minecraft has a lot of options for learning programming without really learning programming. I have never played it but I have seen what others have done in what I believe is creative/builder mode.


Back in college our CS group had an ongoing competition, getting high scores in facebook's chat minigames. Skullduggery was highly encouraged https://www.youtube.com/watch?v=TnJyc3oFsSM


2 games come to mind...

- Turing complete: helped me understand how a computer works, how binary works and what the instructions and operations look like at the hardware level

- Factorio: helped me understand broader aspects like availability, fault tolerance, decoupling, team management, prioritization.


For 2, Codingame's bot programming challenges are excellent. To get high on the leaderboards you need to write super well optimized code and have clever ideas, which is about as fun as a programming challenge gets. To get started, I'd recommend their TRON lightcycle game, which has a great combination of approachable ruleset and deep gameplay.

https://www.codingame.com/multiplayer/bot-programming/line-r...

If you prefer floating point math over integers, their pod racing game is awesome: at one point my algorithm was fourth in the world at it.

https://www.codingame.com/multiplayer/bot-programming/mad-po...

As a bonus, you can use just about any language you want: I know they have at least python, C, c++, rust, Go, Java, javascript, bash...


+1 for CodinGame, I loved their Sprint 2022 challenge (which is now available as multiplayer game). This challenge motivated me to purchase a book about writing intelligent agents and to start studying the subject more in depth.


The inverse worked for me: I wrote a game to become a better programmer.

I recommend most beginners to start with a simple solitaire card game, make a polished card game, complete with tutorial, pausing, win/lose conditions. The reason is the graphics and flow of the game are already a common thing, so planning it is minimal and the focus is on the coding.


The very best suggestions, such as Core War and the Zachtronics games, are already in this thread. One fun little gem that hasn't been mentioned: https://www.unixgame.io/unix50


That's a real GEM for learning Unix text processing utilities and pipelines. And it's obviously designed by Nokia - Bell Labs


It doesn’t seem to exactly fit your description but Python Challenge (http://www.pythonchallenge.com/) has been incredibly fun and rewarding for me back in the day.

It’s a series of riddles that are meant to be solved using the python language. It’s really old now but I’m hoping that some library specific riddles are still relevant. Apart from those few, most of them should be language agnostic as well.

I’ve always wanted to create a similar thing to replicate the experience in JS but never gotten around to it.

Edit: oh also completely agree with most of the recommendations here. Particularly with TIS-100, Factorio and Human Resource Machine.


Okay, I've been nerd-sniped, there goes my Sunday night.

Counter-snipe: https://challenge.synacor.com


I can second the Synacor challenge. After writing the VM and completing the challenge, I ended up writing my own assembler and small compiler for it. Very fun.


I’ve developed Recursive [0], a programming puzzles game that helps understand and master recursion, which is, I think, a topic that many developers have difficulty with.

I’ll be glad to send an AppStore promo code for those who’d like to play it for free (email in website [1]).

Also, I don’t use any analytics tools. So your direct feedback is welcome and highly appreciated.

[0] https://apps.apple.com/app/recursive/id1550504475

[1] https://www.kidori.com


On a similar note is recursed, a puzzle platformer that isn't about programming, but it is absolutely about programming.

https://store.steampowered.com/app/497780/Recursed/


I'll reply mostly on 2. - most of these were already mentioned in the previous thread - [0] Grasshopper, [1] SpaceChem (awhile ago), [2] 7 billion humans (haven't finished it yet, and haven't played for a while), [3] Human Resource Machine and [4] TIS-100. They mostly help to build habits, and persistency, not just being fun.

The "real world" always provides much more interesting "gameplay", but it is sometimes with a too steep learning curve. :)

Edit: And I've been ninja'd by another user, but just remembered that there is another in my wishlist - [5] Baba is you (haven't played it, though)

[0] https://grasshopper.app/ [1] https://zachtronics.com/spacechem/ [2] https://tomorrowcorporation.com/7billionhumans [3] https://tomorrowcorporation.com/humanresourcemachine [4] https://zachtronics.com/tis-100/ [5] https://www.hempuli.com/baba/


Adding to the Zachtronics' game TIS-100, there's also EXAPUNKS which is a fun programming puzzle game. You write programs for one or more bots which can then spawn more and communicate with each other. I haven't finished the game because I just play it on random occasions, but the challenges are interesting. There are also some head-to-head challenges with other players that fit a bit into the Core War vein, trying to maintain control of a television broadcast or similar things with points given for how long your video plays and points deducted for things like killing your opponent's process outright (versus just more clever and faster programs).


Core War:

>Core War is a 1984 programming game created by D. G. Jones and A. K. Dewdney in which two or more battle programs (called "warriors") compete for control of a virtual computer. These battle programs are written in an abstract assembly language called Redcode.

https://en.wikipedia.org/wiki/Core_War


I never understood the point of games that emulate the programming experience. Whenever I play them I feel like I'm wasting my time and I could be making something real.


You're absolutely right, it is extremely hard to emulate the programming experience via such games. If you break down the skills you need in most (with obvious caveats) programming related jobs - reading others' code, explaining your code to others, designing, documenting, brainstorming, breaking down problems, etc, etc, it is difficult to train for those. In the abstract, it makes sense to practice those skills since for many programmers there isn't anything exciting happening day-to-day, and there is a lot of grunt work maintaining existing code bases.

In most physical fields (athletics being an easy example) there is an amazing amount of carry-over from training into performance. Training being where you build up skills and performance being when you apply said learned skill to the performance. But in more abstract and cognition-heavy fields its muddy and vague.


This is where modding scenes shine, you learn a language because you wanna edit a game. My IT career comes entirely from wanting to run my own private WoW server, the open-source ones were written in C++ so I started with that, might not have been the best first language but at least it was something. Now I work with DevOps.

I did manage to run a server with about 140 peak online simultaneously where the USP was a unique PvP experience with cross-faction battlegrounds (to my knowledge my implementation was the first open source one), respawns in FFA areas and such for classic (1.12.1) WoW.

None of this was ever really "real", but it taught me a fair deal about both computers, programming, running a community and life in general.

The open-source project for running WoW servers I used was "cmangos"(gh).


I've played a couple of these games (Opus Magnum, EXAPUNKS). What I liked about them is that they distill the experience of software engineering to "just the fun problem solving" part.

In these games, you don't write RFC, set up CI for your project, do code reviews or battle old dependencies. It's just you, a clear goal and all the right tools to reach it - somewhat similar to assembling Lego (or Ikea furniture) but with the fun of problem solving added.

Making something real would definitely net you a more satisfying end result, but maybe wouldn't be as entertaining. Obviously this depends a lot on what you find fun in programming and how smooth your real projects go!


If an exercise kit is well done, it condenses experience. Think of a mathematics exercise book - gradual progress from basics to limit revealing tricks and consolidating artfulness exercise by exercise. It's doable.


Also, I don't particularly love the act of writing code itself, I like the results (problems getting solved or fun things happening) of which there are none in most of these games.

Interestingly it seems it's the exact opposite for games simulating other kinds of jobs. I hate driving, I do it to get somewhere and nothing else. But trucking simulators? Endless fun and relaxation. Same thing with chopping onions, which I only do to make a nice meal. But in a burger joint simulator? I'll gladly slice tomatoes for two hours!


Zachtronics games don't emulate the horror of the ACTUAL programming experience. They distill away a ton of the most tedious, frustrating aspects (and the just-less-relevant-to-most-programmers'-interests ones, like UI design) and let you focus on the funnest parts: system design and optimization.

In fact, I would argue there is no more efficient, effective, or pleasurable way to practice system design skills specifically than games like Factorio, Shapez.io, Mindustry, and the Zachtronics catalog


That's why I've asked the question - about games that make you feel not wasting your time. Because this will be a breakthrough.


I like CTF stuff. I tried this one called yolo space hacker:

https://store.steampowered.com/app/1341450/Yolo_Space_Hacker...

I like it because now I have something gameified to recommend to people who want to break into computer security. It was REALLY easy for me as someone who's been mired in that world for a long time, though I'm probably going to buy the other missions to see if they pose more of a challenge.

Make sure to download the performance DLC. It runs in a VM but it's better off with virtualbox in my experience than the other options. Opt for compiled tools rather than old perl and python scripts if you want missions to go faster.


How does the game helps to get into computer security?


The goal of the game is hacking into a facility.


Yes, I can see that it's realistic and fun by reading some of the user reviews, like this one:

> Wow, this was so much fun! I work as a DevOps engineer, studied computer science, and have 20 years of work experience. This game creates several virtual machines when starting, with real operating system on them, real web servers, databases, web applications, and shows you multiple ways of hacking around networks, linux, web, php, passwords, authentication, privilege escalation, SQL injection, and MySQL in general. Everything I did in this game came up during my career in work in some form, and I had to protect systems against attacks like this too.

...there were a few things I learned, for example `sudo -l`, I'm going to use that all the time from now on.


Find yourself a MUD (something like www.dsl-mud.org), which is a text based DND type game, and start learning how to capture text and automate in game actions.

Just by trying to automate something like character creation rolls, you'll learn a lot.


Playing Battlesnake has helped me become a better programmer. I've used it to gain experience in multiple new (to me) programming languages as a freeform way to practice without deadlines, I've learned new algorithms and how they apply to game solving, and I am beginning to understand how many game-solving algorithms can be applied to more practical applications since "games" in the game-theoretic sense can just as easily be models of real-world situations where the players are rational people instead of "game" participants. For example, "pathfinding" and "decision making" has many parallels.

Learning game tree searches such as minimax, MCTS and CFR is teaching me about tree/graph algorithms and data structures, how to work with, reason about, and test explosive search spaces where the entire tree can't be feasibly completely exhausted, in the process of researching these things I've learned to read whitepapers in the literature that would otherwise be scary to me as a developer and actually care to understand the math, it inspired me to tinker with Formal Methods including TLA+, and all the while having fun and making friends.

Learning Goal Oriented Action Planning, or GOAP (which I actually didn't apply to Battlesnake in the end, but I never would have found it if I wasn't looking) helped me optimize my real-world productivity by translating the concepts from game AI to personal task planning. In my head there is an analogy now between handling backlogs according to the current working context, and a GOAP-like stack based finite state machine. Learning a simple game algorithm helped me procrastinate less.

For newer developers, you'll also out of necessity learn many real-world web development and ops concepts because the way Battlensnake works is that you run your own web server conforming to their move API. So you have to keep your snake AI up and reachable, responding to each request within the allotted timeout, and know the basics of HTTP on day one. Games can also run concurrently so you learn how to deal with concurrent games and whether to make them stateful or stateless between turns, which can be a different experience on different web frameworks/languages and might teach you about things like threading or the actor model or distributed systems.

For advanced developers, there's always somewhere to go next. Your snake AI can be anything from hard-coded rules to tree searches (as mentioned above) to deep reinforcement learning.

https://play.battlesnake.com/


Battlesnake is fantastic for driving learning and providing motivation. The way that you can go learn something, then apply it and immediately see an improvement is fantastic for staying motivated.

I learnt more from participating in a Battlesnake league then I did in the previous 3 years.


More applicable for kids, although certainly of interest to adults too: Minecraft. Any interest in Redstone will push players towards learning the basics of binary logic, without even realising what they're learning will be applicable down the line. Plus, it has (I assume) the largest modding scene of any game - there's a lot of people out there who have learned Java just so they can target Minecraft/CraftBukkit.


OverTheWire wargames. I played first 10 levels, it's kinda fun, kinda frustrating but it made me read manuals of 'grep' and 'find' commands on bash. So it made me a better programmer for sure. https://overthewire.org/wargames/


I feel like I've always gotten the most from Exercism. [ https://exercism.org/ ]. It's similar to Code Wars, in some ways, but I like the interface on the CLI, I like that you can get mentoring, I like that there are multiple languages.


I learned Forth thanks to Minecraft RedPower2 mod. Whether it actually made me a better programmer can be disputed.

I don't think any game will make you a better programmer. It can get you interested, sure, but becoming a better programmer is only so much related to having in-game fun, and is often a matter of more self-discipline.


I'm not sure if it qualifies as a programming game vs. a gamified way of teaching programming concepts, but I liked The Deadlock Empire for exploring concurrency issues: https://deadlockempire.github.io/.


To the list of Zachtronics games, I'll add Opus Magnum, which is the one that I found most rewarding.


Opus Magnum is the Zachtronics game that resonated most with me. It's visual, like SpaceChem, but I also like the setting and find the solutions to be very satisfying.


I've already mentioned it in another comment, but (being unable to edit my question already) this is what I was thinking when I asked the question: an addictive game with progressive complexity and (possibly) time-limited challenges that make you feel like you didn't waste (hours of) time because of the knowledge (skills) you've gained.

I guess, I have to try some of the games that everyone has mentioned.


Check out flexbox froggy. There are good games about git too. I tried the Twilio games but I think those are better for young kids. It takes too long.


For git specifically, I quite like https://learngitbranching.js.org/. Helps connect the visual/spatial understanding with the raw CLI commands.


Many good suggestions in here already, so I'm just gonna add Space Engineers.

It's a voxel-based spaceship building game, where you can quite literally design your spaceship from scratch. If that's not enough for you, you can interact with your creation by writing c#-scripts that are stored in physically accessible programmable blocks.

There's also a large modding community you can get into.


I started programming with “learn to program basic”, a series of animated programming tutorials in BASIC lightly disguised as a game.


Not specifically programming, but I firmly believe that playing Roller Coaster Tycoon as a kid dramatically helped spur my interest in STEM and learning in general.

It was my first introduction to: physics, accounting and finance, data visualizations, and more.

Roller Coaster Tycoon 2 holds up remarkably well today, either natively or via OpenRCT2. Highly recommend it to anyone and everyone.


Both are somewhat obliquely related to programming, but I really enjoyed incredible.pm and (the demo of) vim-adventures.com


I highly enjoyed TIS-100 and Shenzhen-IO, though I'm not even close to completing either. They wouldn't make you better at a specific language (even assembly, since they use a pseudo-assembly) but I think they'd be useful to get better at problem solving and breaking down algorithms into their most basic parts.



During my teenager years Colobot helped me cement a lot of the core programming concepts: https://en.wikipedia.org/wiki/Colobot

The syntax is very C++/Java-ish.


ZZT. It’s one of Tim Sweeney’s (Of Epic fame) early games.

It was my intro into true OO programming. You program literal objects to interact by message passing.

You should be able to pick it up all over the internet. It’s abandonware but has a pretty good community.


Trade Wars 2002... A popular old BBS door game with many scripting options to automate trading and many other aspects of the game. Also when I started getting into hacking and exploits. MajorBBS was a lot of fun in that regard.


There are plenty of games that helped me become a better programmer, but none of them were programming games. You can choose games you enjoy that are open to modding and have your fun programming mods.


I got more confident in my Assembly skills after playing a lot of TIS-100.


Not programming games but Starcraft and Quake (keys set to esdf instead of wasd). They taught my left hand where to be on the home row and I credit them for indirectly teaching me touch typing.


Does Advent of Code count?


It seems that it counts by reading the description: "small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other." But since I haven't used it, you or someone else can have the final say. I was thinking of an addictive game with progressive complexity and time-limited challenges that make you feel like you didn't waste time because of the knowledge you've gained.


Any game that supports extension via modding is a potential to learn more about programming. I think when programming is the game, it’s kinda boring and feels too much like work.


Let us also remember that before programming:

The NAND Game, nandgame.com

is "obligatory".


MHRD. Cool little game about Hardware Description Languages. Takes you from designing basic logic gates all the way up to a microprocessor.


Super Star Trek, chess and Conway’s game of life. Taught about code size and efficiency and how to tailor the approach to the problem.


While this game doesn’t teach you to code, I would argue that Portal (1 and 2), teach you how to solve programming like problems.


https://www.pwnadventure.com

LiveOverflow did a series on it


If you want to learn assembly or how computers work at a lower level, play TIS-100 by Zachtronics.


www.codecombat.com is focused on kids but I found it great for beginners in general. You can choose to learn JavaScript or Python. I had a lot of fun watching and helping my gf go from 0 to being able to write basic JavaScript.


Goretek and the Microchips, but y'all probably a little young for that. :-D


I think some of the Zachtronics games may be helpful to learn about Assembly.


leetcode.com is an interesting puzzle game and is language agnostic.


the game of having bills to pay.


The Typing of the Dead


Kids these days...

Go read a book!


the programming game


None




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: