Improve your shell skills by writing a game

I spend a lot of time in shell. Like really a huge amount of time. I use my editor through a shell. I test my code locally in the shell. I could safely assume that 70 procent of my productive time is spent on various shell activities and rest is probably spent in the browser.

Yet, I known very little about writing a shell script. I didn’t really even known the difference between sh, bash, dash, zsh and csh. I always planned to learn it, but I have postponed it endlessly. There was always something cooler to learn, something more interesting to read about.

But one day I have stumbled upon a Github repository that implemented a breakout like game in pure shell script. It was a strange idea. Shell is probably not the best language for game development. It is not even a worthy candidate. Yet, the process of writing a game could teach me a lot about loops, conditions, functions and the rest of the basics in any language. So I decided to make my own version of that game. And it was valuable experience. In the next the post I will try to share some of the things I have learned about shell scripting, and hopefully encourage you to also make a game in bash, dash, zsh … or whatever.

shot.png

Here is the link to the full source of the game named squa.sh.

See you in the next post!

 
4
Kudos
 
4
Kudos

Now read this

The ASCII table

Originally I wanted to write about Unicode, but I have realized that it is better to start out with the basics, and you can’t get more basic than the ASCII table. As computers can only represent two kind of values — true or false — some... Continue →