Code Project: Build a mouse game with Python


Most modern games take thousands of man-hours to create, not to mention an army of artists and musicians, but there's still some scope for solitary hacker to write something entertaining. After all, it didn't take a team of 500 coders and a Hollywood movie-set budget to create Tetris - Alexey Pajitnov managed pretty well on his own (until various filthy capitalist running-dogs of the West ran off with his idea, of course...)

In this tutorial, you're going to learn how to make a really simple mouse game with Python. If this is the first coding tutorial you've read - and you've certainly never written a line of Python code before - you'll be pleasantly surprised by how easy it is to understand; Python code is famous throughout the programming world for being very much self-explanatory.

Arduino hardware hacking: Part 1


Arduino is cool. It's cool because it's a tiny device - about three inches by two inches - that comes with a USB port and a programmable chip. It's cool because you can program it using a very simple programming language known as Wiring.

But most of all, it's cool because the entire reference design for the hardware is available under a Creative Commons licence, so you're free to build your own if you want to. However, that's probably a little extreme for most people, which is why you can also buy pre-built Arduino boards that are ready for action and available at very low prices.

In this tutorial, the first part of a mini-series, you'll learn all you need to get started with Arduino hardware hacking...

Code Project: Create a web server in Ruby


Most of us are aware of Ruby through its modern-day Ruby on Rails incarnation, which is a framework for developing large-scale websites. This has been used on talked-about websites such as the Basecamp, Jobster and 43 Things sites and is shipped with the latest version of OS X, Leopard.

Given Ruby's very recent step into the coding limelight, it's surprising how long the language has been in development: since 1993! Created by Yukihiro Matsumoto, Ruby was first released to the world in 1995, and was designed to reduce the menial work that programmers typically have to put in. Why should we have to battle with the syntax of a language when what we want to achieve is really very simple?

The beginner's guide to coding


You don't learn to ride a bike by reading books. No one can become a pilot by listening to someone else talk about plane journeys they've been on. Instead, we learn by doing, by trying, by failing and - most importantly - by succeeding. Because when you feel like you're winning, you get confidence in your skills and know that you can do anything.

Programming your computer is no different: it might seem hard, confusing or perhaps even boring, but it isn't. In fact, programming is hugely rewarding, because you exercise complete control over your computer. You can make it do things the way you want them to happen. And, if you're good, it can also lead to a whole new career.

This tutorial will teach you programming by making you program. Along the way you'll learn some theory, you'll learn some jargon, but most importantly you'll write your own program. More specifically, you'll write your own game. Even more specifically, you'll write your own super-cool game for Linux. Excited yet? You should be. Let's not hang around any more - it's time to get started...

Programming languages that melt your brain


In their day-to-day jobs, coders naturally focus on the more commonly used languages, such as C++, PHP and Python, but there are plenty of more left-field choices, such as Ruby and assembly, that are well worth learning to broaden your coding knowledge. Now we're going to have fun with some really esoteric languages, all of which are so fabulously crazy and entertaining to try that you'll look at programming in a completely different way.

Before continuing, you should know we'll be assuming you have a general programming background; that said, even if you've never written a line of code in your life, you'll still find some of the concepts here compellingly mind-twisting. You wouldn't want to use any of these languages to write any large, complicated applications, but you'll learn a lot about the makeup of programming languages. Plus C, for all its fiddliness, will seem like a gorgeous paradise once you've spent some time in these foreign lands...

Practical PHP Programming has a new home


We've had a number of complaints from people saying that the e-book Practical PHP Programming (also available in print, albeit cutdown, as PHP in a Nutshell from O'Reilly) was running on a slow server, which made it rather hard to read.

So, thanks to the fact that the author also just happens to be the editor of Linux Format and TuxRadar, we've moved the entire book to our super-fast server. What's more, he also took the time to update the text for the first time since it was originally released, so it now covers lots of new functions and features added to PHP in recent releases.

So, update your bookmarks: the new home for Practical PHP Programming is This is just the beginning of our plans to upload a great many more programming tutorials in coming weeks - watch this space!

Code Project: Build a flash card app


In this coding project, we're going to create a flash card program to help you remember foreign words. It displays an English word and asks you to choose its German equivalent from a list of three randomly chosen options, keeping a score as you progress.

But it's not just limited to German – you'll be able to use it for any language, or indeed for anything else you want to learn! You could even set it up to display the name of an animal, having the program test you on its species.

Hudzilla Coding Academy: Project Four

Code Project: Build an IRC bot


Here at TuxRadar we love quick little programming projects, and hope you do too. The word 'projects' is important here: we're not going to dwell on theory or mundane technical gubbins, but instead look at making cool things - after all, programming is the most fun when you're actually making things rather than spending hours learning about tedious loop constructs!

In this tutorial we're going to produce an IRC bot written in Perl. If you're an old-school internetter, you'll probably have used IRC before; if not, see the Hang on, what is IRC? box explaining the basics overpage. In a nutshell, IRC is a real-time chat protocol, commonly used in open source projects for interaction between developers. It's simple, fast and easy to understand - and best of all, it lets you create virtual participants in the conversation.

Code Project: Build a Space Invaders clone


Programming is great. You get to create something new, stimulate your brain and have fun along the way - especially if you're programming games. So we're going to show you how to write your very own Space Invaders lookalike called PyInvaders - but don't panic if you're tired of dull programming theory: take that palm away from your forehead. Here we'll focus on doing Cool Stuff(tm), making a game work instead of warbling about algorithms, data structures and object oriented polymorphism encapsulation. Or whatever.

Consequently, to follow this guide it helps if you have some prior programming experience. We're not going to explain everything in depth; if you've dabbled in some code before, and know your arrays from your elbow, you won't have any problems. For those completely new to programming, you might find some of the terminology a bit bamboozling, but you don't have to understand it all. Just take in what you can, grab the source code from the DVD and start experimenting by making changes yourself. That's how all great programmers got started!

So, as mentioned, we'll be making a mini Space Invaders clone. Our choice of programming language is Python due to its simple syntax and code cleanliness - it's very easy to read. PyGame, a language binding that wraps the SDL multi-media library around Python, will provide the graphical plumbing for our program, saving us from the chore of manipulating images by hand. Most distros have Python pre-installed, and PyGame is available in nigh-on every repository, so get the tools, open up a text editor, and let's get cracking...

Hudzilla Coding Academy: Project Three

Hudzilla Coding Academy: Project Two

Hudzilla Coding Academy: Project One

Make your Bash scripts more efficient


We all hack together quick Bash scripts to perform mundane jobs, but rarely do we spend a lot of time wringing every bit of performance out of them. Still, if you're writing code that'll make its way into the hands of others, it's worth spending a bit of time making it more efficient. HackTux's 10 tips cover arrays, compound commands and other tidbits you can use to make your scripts faster and cleaner.

Version control with Git


In depth: Anyone who's used SVN, CVS or one of the other major versioning tools for backing up, reverting and (trying to) collaborate will understand what drove Linus Torvalds to give in and write his own. Versioning software often drives coders mad - and Git has been called the versioning system that you need a PhD to understand. The complexity comes from its simplicity and its aim to make it easier to work in large groups of distributed developers, but if you approach Git calmly you'll get a lot from it.

Hudzilla Coding Academy: Introduction

Username:   Password: