HACKER Q&A
📣 gpa

Which programming games helped you become a better programmer?


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).


  👤 bobinux Accepted Answer ✓
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/


👤 madmax108
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


👤 heliophobicdude
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


👤 latency-guy
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.


👤 MarioPython
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.


👤 QuadmasterXLII
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...


👤 adamredwoods
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.


👤 Bondi_Blue
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

👤 erkmene
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.


👤 chaabani
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


👤 ttanev
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/


👤 optimalsolver
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


👤 robotburrito
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.

👤 jamal-kumar
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.


👤 I_dev_outdoors
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.


👤 xtagon
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/


👤 opheliate
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.

👤 kubi07
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/

👤 terryp
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.

👤 js8
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.


👤 DylanSp
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/.

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

👤 gpa
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.


👤 32kfjh23
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.

👤 encrux
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.


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

👤 dcchambers
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.


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

👤 Night_Thastus
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.

👤 lcordier

👤 mjouni
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.


👤 michaelrpeskin
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.


👤 Threeve303
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.

👤 Stevvo
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.

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

👤 damagednoob
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.

👤 Apreche
Does Advent of Code count?

👤 breckenedge
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.

👤 mdp2021
Let us also remember that before programming:

The NAND Game, nandgame.com

is "obligatory".


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

👤 jleyank
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.

👤 hitpointdrew
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.

👤 beprogrammed
https://www.pwnadventure.com

LiveOverflow did a series on it


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

👤 e9
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.

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

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

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

👤 jayski
the game of having bills to pay.

👤 styluss
The Typing of the Dead

👤 pdenton
Kids these days...

Go read a book!


👤 syngrog66
the programming game

👤 lordkrandel
None