20 GOTO 10

I have secrets to tell you, gather round and listen closely.  Look at the picture below, this is the screen of a bygone era.  The blinking cursor.  It is responsible for the success of the software industry in Great Britain.

Why?  Keep looking at it.  In the 80’s this is all you got.  No nice menus, no graphical user interface, just the blinking cursor.  It’s there, ready, waiting for your input, waiting to obey your commands, without you the computer is nothing.  It needs your input to be anything.

This simple fact gave you the feeling that the computer was watching you, and this feeling would work upon your mind and lure you into trying to make it do something.  Anything, it didn’t matter what.

The desire to make it do something motivated a lot of people to learn a few basic commands.  Those people then went on to be great programmers and had long and successful careers in software.  Maybe you, reading this, now stand upon that same precipice?

It may amuse you to learn that the first program most of my generation learnt was one designed to annoy the teacher.  This, simple, program has entered software programming lore and popular culture.  You can even buy t-shirts with it on.

10 PRINT "PROFANITY ";
20 GOTO 10
RUN
PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PRO
FANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFAN
ITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY
PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PRO
FANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFAN
ITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY
PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PROFANITY PRO

This would basically fill the screen with your favourite swear word!  Apart from doing it in high street shops, like Tandy and Dixons, most people would do this when the teacher left the room for a moment.

If you were really clever you would also enter two commands before your program, this would disable the Escape key and prevent the teacher from aborting the program using the Break key.  Maximum annoyance!  They would have to power cycle the machine.

*FX13,6
*KEY 10 "OLD |M RUN |M"

I personally think it would be a huge shame to deprive today’s teachers of this same prank.  Especially since you can bet your grandmother that your teacher probably pranked their teachers in exactly the same way 20 years ago.

Here is how to do it on a Raspberry Pi

With practise you will be able to do this really quickly, perfect for when a friend steps away from their keyboard for a moment.  When at the Linux command prompt, so you can see the blinking cursor, enter the command python (see below).

pi@raspberrypi ~ $ python
Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> _


When you see the three arrows above with the blinking cursor enter the code below exactly as it is shown. Importantly note that on the second line there is a tab (image above, look on the left above Caps Lock) just before the print command!

>>> while True:
...	print "PROFANITY ",

Press enter a few times and you should see the screen fill with your chosen message!

You may notice that if you have chosen a four letter word that it fits into neat columns and rows on the screen, you can modify this by including a space character at the end of the message.  Then you see a kind of unreadable blur which is like a profanity time bomb waiting to go off.  You can press Ctrl – C to stop it whereupon the message becomes readable.  Ctrl – D to exit python and go back to Linux.

Now, if you really want to grief someone then read on.  Here is the version where you can’t stop it!  Well, actually you can but it’s harder and often requires a reboot.  Be sure to use the tab key to lay out your code exactly as it is shown here.  This is a fundamental principle of the python programming language.

>>> while True:
...	try:
...		print "PROFANITY ",
...	except KeyboardInterrupt:
...		print "MORE PROFANITY ",

You can sometimes manage to abort this program by button bashing Ctrl – C.  But otherwise to stop it safely press Alt – F2, login again and type sudo reboot to restart the Pi.

Good luck and please post below if you either have any improvements or you manage to prank your teacher!

Raspberry Pi Store

Today it was announced that there is a Raspberry Pi app store available!  I highly recommend everyone to download and use this.  If you have ever used iTunes, Steam or the Ubuntu Software Centre this is basically the Raspberry Pi version of those.  It’s here to stay and I think it’s going to be huge.

To access the store you need to load the X desktop by typing startx at the Linux command prompt, you’ll now see that there is a new desktop icon named Pi Store (above).

Upon first use you will need to click the Add new user button and go through the sign up process. Once you log in you can click on the Explore icon in the top left and have a look at what is on offer.

The initial line up of software will probably seem somewhat limited, but as time goes on the number of programs available will increase. I don’t think I need to provide instructions on how to get the apps installed and running, everything is quite straight forward and intuitive. Some apps require an install script to run though, this is so that any prerequisite packages that the app needs can be installed. You’ll see a prompt asking for your permission to do this and you just need to press Y for yes.

Apps that you install will be listed under My Apps for convenience. From there you can manage all the applications that you have installed. I recommend you try a game called OpenTTD and an application called Schism Tracker (see above). These were both submitted to the Pi store by me and therefore appear under my developer account. I take no credit for the work that went into developing them though, they’re both open source applications that are free to redistribute (under GPL) and are therefore also free on the Pi store.

OpenTTD is an open source version of a game called Transport Tycoon Deluxe.  The objective is to connect different sites on the map by road, rail, air or water and make money out of transporting goods, coal, passengers etc.  It’s a great simulation game and a nice tutorial for it can be found here.  I would recommend, for performance, that you turn off two detail settings to speed the game up.  These can be found under the cog icon, in game, and are named Full Detail and Full Animation.  A smaller map size may also improve performance, perhaps choose 128 x 128 or even 128 x 64.

Schism Tracker will be huge fun for you if you remember module files from the 90’s.  Modules, or MOD’s as they were known, are basically songs produced without the need for any expensive music equipment.  A lot of computer game music was made this way back then so if you’re interested in making music of your own you can use this software to do exactly that.

The program is provided without any song files, so you will need to go find these and download them yourself.  A good place to start is The Mod Archive (go Music > Charts > Top Favourites).  I fully intend to provide a tutorial, on this site, for how to start making your own songs, but for now – it’s probably just as much fun to go and listen to what other people have made.  The MagPi issue 2 also has an article on Schism Tracker (page 22).

Now, the real genius of this app store is that anyone can upload their own programs to it. Click the Upload button in the top left and you can start creating your own developer page.

So, if you have a application or a game in development, this could be your chance to make a bit of money for yourself. When you upload a program you are in control of everything like the box art, the screen shots and, of course, the price to sell at. In my view this app store is going to seed the development of a lot of games for the Pi.  Only time will tell though.

Any programs you upload will have to go through something called CAP.  Community Approval Process, this is essentially a form of peer review to make sure your application is not malicious or just plain rubbish!  Once you have passed CAP your app or game will then be visible to buy for other users of the Pi store.

Enjoy!