Spacewar

 

Hello everyone! This is the 13th post on this blog. We have crossed the Rubicon, there is no turning back! With 12 posts left this year, I feel so happy that we got this far. Your response to this blog keeps me overwhelmed. This week we will look at the very first arcade game! It is with a great sense of nostalgia that I publish this post.

It is amazing the hacker ethic that got the computing industry to this point is nearly lost. Personally, I look back to a time where you could go to sleep with a fellow programmer in the room. Sadly those days are gone! Now with venture funding entering into the scene, the days of hackerdom are over. Non Disclosure Agreements (NDAs) and Non Compete Agreements (NCAs) are the norm these days. In the years to come, I know that I will have to get a lawyer on my team. But enough talk. Let’s get to this week’s post…

In the annals of hacking history, there are many great computing machines however; none would change the history of computing as much as the (Programmed Data Processor-1) PDP-1. Designed by Digital Equipment Corporation (DEC), it was donated to the MIT labs. The PDP-1 replaced the TX-0. The TX-0 was the world’s first personal computer. Costing $3 million in the late fifties, it would trigger the formation of a dedicated community of hackers around it.

The PDP-1 however would go on to make history. First produced in 1960, it would be on this computer that music would first be created via a computer program and the first computer game would be created.

When the PDP-1 was delivered to MIT, it came with a simple collection of systems software, which the TX-0 hackers considered completely inadequate. The TX-0 hackers had become accustomed to the most advanced interactive software anywhere, a dazzling set of systems programs, written by hackers themselves and implicitly tailored to their relentless demands for control of the machine.

Alan Kotok already an accomplished TX-0 hacker designed a debugger for the PDP-1 called the DDT. It was him and a dedicated team of hackers that would write their own assembler over a weekend. They accomplished this feat by reworking code from the TX-0 and not sleeping!

During the summer of 1961, a plan for the most elaborate hack yet was devised. Steve Russell and his friends came up with a plan to create an elaborate display hack on the PDP-1 using the CRT screen. They collectively agreed that the most effective demonstration of the computer’s magic would be a visually striking game. Given their collective background in science fiction, the team decided to build a game that would feature space warfare.

Steve Russell delayed starting work on the project for several months. When pressure mounted from other hackers, he muttered that he had not started the project because he had not figured out how to write the elaborate sine-cosine routines necessary to plot the spaceships. Given the spirit of hackerdom, a library was found for the trigonometric functions and work could start.

At that point, Steve Russell had no excuse. So he spent his off-hours writing this fantasy PDP-1 game, the likes of which no one had seen before. He began in December 1961 and when the calendar wrapped around to 1962, he was still hacking. By that time, Russell could produce a dot on the screen that you could manipulate: by flicking some of the tiny toggle switches on the control panel, you could make the dots accelerate and change direction.

He then set about making the shapes of the two rocket ships: both were classic cartoon rockets, pointed at the top and blessed with a set of fins at the bottom. To distinguish them from each other, he made one chubby and cigar-shaped with a bulge in the middle, while the second he shaped like a thin tube. Russell used the sine and cosine routines to figure out how to move those shapes in different directions. Then he wrote a subroutine to shoot a “torpedo” (a dot) from the rocket nose with a switch on the computer. The computer would scan the position of the torpedo and the enemy ship; if both occupied the same area, the program would call up a subroutine that replaced the unhappy ship with a random splatter of dots representing an explosion. (That process was called “collision detection.”)

In the later stages of programming, Bob Saunders helped Steve Russell out, and they hacked a few intense six-to-eight-hour sessions. Sometime in February, Russell unveiled the basic game. There were the two ships, each with thirty-one torpedoes. There were a few random dots on the screen representing stars in this celestial battlefield. You could manoeuvre the ships by flicking four switches on the console of the PDP-1, representing clockwise turn, counter clockwise turn, accelerate, and fire torpedo.

Once a rough version of the game once shown to the community of hackers, there was no going back! Since the code was open-source, modifications beyond the original design were made to it.

Peter Samson for instance loved the idea of Spacewar, but could not abide the randomly generated dots that passed themselves off as the sky. Real space had stars in specific places. “We’ll have the real thing,” Samson vowed. He obtained a thick atlas of the universe, and set about entering data into a routine he wrote that would generate the actual constellations visible to someone standing on the equator on a clear night. All stars down to the fifth magnitude were represented; Samson duplicated their relative brightness by controlling how often the computer lit the dot on the screen which represented the star.

Another programmer, named Dan Edwards was dissatisfied with the unanchored movement of the two duelling ships. He felt it made the game merely a test of motor skills. He figured that adding a gravity factor would give the game a strategic component. So he programmed a central star-a sun in the middle of the screen.

The variations made to the game where endless. Spacewar was played a lot of times. So much so that Russell eventually wrote a subroutine that would keep scores (High Scores Screen). In the course of playing Spacewar, the tedium involved in working the switches on the console of the PDP-1 led to the invention of the first computer joysticks! The first computer joysticks had their control boxes made of wood with Masonite tops. They had switches for rotation and thrust as well as a button for hyperspace.

Like the hackers’ assemblers and other programs, Spacewar was never sold. It was placed in the drawer for anyone to access, look at, and rewrite as they saw fit. Gradually the popularity of the program would spread and DEC engineers would use it as a final diagnostic program on PDP-1s before they rolled them out the door.

Sources

Hackers Heroes of the Computer Revolution by Steven Levy

Wikipedia en.wikipedia.org

You can get a copy of the presentation here. Sorry that this week’s post read like a thesis 🙂 Sometimes we have to look back in order to move forward. Will be back in the new quarter to do my 12 posts and go home. I made this promise before and I make it again: “As long as you keep coming, I will continue posting”.

Software Freedom Day

Last week was Software Freedom Day being a saturday, I decided to spend the day at the event. In Ghana, it held at the Ghana India Koffi Annan Center of Excellence in ICT. It was my first technology event in Ghana. I hope to give my take on what went down.

The program started with a documentary on the open source movement. Presentations where done on some open source projects like Koha which is an open source integrated library management system and jquery cipher which is a front-end encryption tool.
Of course there where presentations on other products but the above represent the two I find most impressive. Koha is international while jquery cipher was developed by Samuel Asirifi a Ghanian. Beyond those two products, I was not really impressed by the rest of the event.

Business Models

The above diagram is called the IT Value Chain. Like I talked about in my post on Bringing Ideas to Life, the first option is to awaken a dragon while the second is to carve one yourself. Being away from a Graphic Designer, I had to open Microsoft Paint and do the work myself! The above image is Programmer Art. So if you like the above image, please feel free to use it for whatever purposes you like. I will not mind 🙂 I was given the information free! If you decide you want to beautify the image, please do so and send me a copy.

When you look at the above image, it explains the different players in the Information Technology sector. At the top of the pyramid are the programmers and graphics designers. These are the guys with “The Skill”. The only problem being that having power and knowing how to use it are not the same thing. Below content producers are the bloggers who bring all the players together. For content producers, apart from blogging, you can also get to this stage by having a product that make people talk about you. Blogging by itself requires no skill to start. It simply requires the ability to write the way you talk 🙂 anyway that’s how I do it.

After aggregators/hosts, the next two levels are not for mere mortals! Collaboration is then a must. In West Africa the most visible access providers are Microsoft and Google. Microsoft brought us the computer and Google brought us the internet. Therein lies the problem. Microsoft is seen as the enemy by open source movement which is strongly supported by Google. In the realm of advertising, Google and Inmobi are visible players.

Straight Talk

Someone once said “A belief if something we would argue about, a conviction is something we will die for”. The views that come next are my sincere opinion on the true state of the open source movement. Reader discretion is advised!

The first tech event I attended in my life was Google Nigeria. It was held at the University of Lagos in 2010. I don’t remember the dates but it held from Thursday to Saturday. I remember snubbing the event up till Saturday which was the program for students. It was nice attending. Subsequent events showed the Google was serious about Africa as a whole and were not Microsoft.

Bear in mind that this is 2010 when Microsoft was seen as ‘evil”. Google preached and we believed. Some of my friends even got baptized. I wonder why they could not convert me…. Anyway that was before GNBO. If there was anything that proved to me once and for all that it is all business, it was GNBO. I remember being one of the earliest adopters it was cool to be able to create a website in just 2 hours!

In the weeks to come the outburst would start from my web designer friends. Many would lose what small businesses they had. Truthfully Google opened the web space in Nigeria but at the cost of the guys on the ground. 2011 was the year I decided that it was “Every man for himself and God for us all!”. In the days following, I have not seen anything to change my mind on the matter.

How does this connect with Software Freedom Day? Easy! we have a bunch of guys selling their own agenda to the detriment of people on the ground. While I sincerely believe in the open source doctrine, it must be tempered by wisdom. FOSS (Free and Open Source Software) is the only way that Africans have a chance in technology.

However, there is The Danger of the Single Story that sorry state where we take the trees to be the forest. Any technology business needs to consider its technical as well as it financial sides. In technology today, a common business model is freemium. It gives a business a chance to try a product free while it evolves a business model.

Today, I am firmly in the Microsoft camp. My survival is at stake! The Windows 1 operating system has evolved up to the point where it now on Windows 8 that is 27 years of work! Open source has nothing to meet this challenge! No open source project has such a record. Any that for me is what is scary about Software Freedom Day. Rather than talk about what the future holds once Microsoft closes ranks with Windows 8 on October 26th, they seem to be this continuous rant on the virtues of free software.

As a programmer who has had to look through lines of code I did not write in the name of free software, I will pass! The first rule of civil engineering is that you cannot build on sand! I would rather build a company on Windows 8 as a foundation and have FOSS as an extension of that company than build the entire stack on FOSS.

Conclusion

In today’s fast-paced business environment, there is the need to focus on rapid delivery of products. FOSS is accompanied by a lot of noise that most programmers tend to think that it is the way to go. It is truly amazing that the people making the noise are not programmers!

Mythology recalls that Odysseus ties himself to the mast of the ship in order to listen to the voices of Sirens while the rest of his men have their ears filled with wax. As a programmer, that is my current stance! I will do my due diligence on FOSS tools out there because once in a while the open source movement produces great tools. But in the end in a choice between Microsoft and FOSS tools for any project I am working on Microsoft will win!

Wetin Dey Shele

Programmers and Women

Happy middle of the month everyone! Tomorrow is Software Freedom Day. I talked about it in last week’s post so I won’t talk about it this week. The image above is called Programmers and Women. As you can see, the woman is … and the programmer is clearly unaware. But it isn’t just women. The dark side of programming is that programmers can easily lose themselves in their work and lose their grip on “normal” life.

This week we will be featuring the first guest writer on this blog. In the spirit of Software Freedom Day, I talking about wetindeyshele.com. I personally believe in products that are creative and innovative. In terms of Technology Wizardry, do I find wetindeyshele.com technically complex? The answer is no! But is it useful and does it have great market potential? The answer is yes! I will stop talking and let Oge Nnadi do the rest …

Summary

I made the entrepreneurial events calendar, using open source and free services and software including Google Calendar, Google Analytics, Heroku, and Git.

I’ve always been a fan of open source and free software. I subscribe mostly to the tenets of free software foundation, and during my undergraduate computer science courses, I was trained on open source tools. So when I decided to create a public calendar to track all the tech and startup events happening around me, I naturally turned to such tools.

The Wetindeyshele Website

Google Calendar

Wetindeyshele is a single Web page showing a calendar with upcoming and past startup-related events; the arrows near the top let a user browse through different months. This calendar was made with Google Calendar and simply embedded in the page. The instructions for embedding a Google calendar on your site are straightforward, but be sure to test the embed when you are logged out of your Google account so you confirm that others will be able to see the calendar as well.

Google Analytics

In order to track the number of visitors Wetindeyshele gets, I placed a block of Google Analytics tracking JavaScript code into the page.

This code will differ based on the site you’re tracking for. Adding it let’s me see information about the site’s visitors like what country they’re from, what site referred them, how long they spent on the site etc.

The Google Analytics Dashboard

Git and Heroku

I like to track the changes I’ve made to all the software I write over time; it helps me easily roll back mistakes I make. My revision-control software of choice is Git and I prefer it over others such as Subversion because I can easily see the entire history of the project without running a server or having to be online.

One benefit of this choice is that it lets me easily deploy my code to my Web host, Heroku. I use Heroku for two reasons: 1) they provide a free hosting option for really small applications, and 2) they use Git as a transport mechanism for deployment so I don’t have to use, for instance, a separate FTP client to upload my site. In practice, this means that after I’ve made new changes to the site on my local machine, I can type

> git push heroku master

at the command line to immediately deploy the changes. It makes my life just a bit easier.

Conclusion

That’s it for the open source and free tools I used to create Wetindeyshele. For more complex sites where I need finer control of the software running on the server, I sometimes use the server operating system, Ubuntu Linux and run my own Apache Web server. But that’s an article for another day.

About the author

Oge Nnadi likes to teach Web development, create algorithms, and watch anime.

Bringing Ideas to Life

Whao! Today everything conspired to keep me from blogging. Start with a project deadline that is due next week add a tiring trip home and cap it up with my preferred cybercafe being closed and you have an idea of what my day was like. Today is the 10th post on this blog! Today, I make this solemn promise “As long as you continue coming, I will continue blogging”.

10 posts! It has been a long road well traveled. Starting was difficult, now that I am getting the hang of it, I find it enjoyable to be able to share my thoughts with others. Thanks to everyone for feedback and comments. This blog would not be where it is without your help. 15 posts left and that’s it for this year! It will be exciting getting in the 13th post on this blog on the last Saturday of this month.

Next week will be Software Freedom Day all over the world. It is basically a celebration of Free and Open Source Software (FOSS). In the past years, this movement has served as a counter balance to the monopoly of software behemoths like …(No need to revisit the past) 🙂 In providing alternatives to proprietary solutions, the FOSS movement allowed people use tools that would normally be out of reach to them. As an African, my favorite business model for technology is freemium. The goal of freemium is to look at what you can get for free and the start payments for extra value. But that is not the topic this week!  So enough of Software Freedom Day and on to bringing ideas to life!

In my years of studying the process of creation, the closest model I can find is that of Robin Hobb in her classic novel Assassin’s Quest. Assassin’s Quest basically represents book 3 of the Farseer Trilogy.

The basic gist is this. A king’s domain is being attacked by pirates. Every means of mounting a successful defense fails. In this world, there exists two kind of magic: The Wit and The Skill. The Wit enable communication and bonding with animals while the Skill is for human beings. The Skill holds a final secret: The secret of transmutation of how a dragon can be carved out of stone!

In this world those with the Wit are killed when they are caught. The narrator of this story is Fitz Chivalry the bastard son of the former crown Prince Chivalry who had to give up his throne once it became known that he was father to a bastard. The narrator is unlucky in that he is blessed with both the Wit and the Skill. Because of the power of the Skill, instruction in its usage is meant only for royalty. Think of the Skill like the force in Star Wars.

In the course of the story, the new king tries to build a coterie to help him. A coterie is a team of Skill-users who are at the service of a Skillmaster. All to no avail! Finding some scrolls, the new king Verity who is the brother of Prince Chivalry uncovers details of a garden where one of his ancestors went to for help when the kingdom faced the same pirate problem. In the garden are sleeping dragons and stones to carve new dragons.

The preferred option is to awake a dragon because for a dragon to be carved, a human being must lose his life. Unable to awaken the dragons, Verity has to carve his own dragon. In order to do so, Verity transfers all his memories, passion, pain and frustration for his dragon to take be able to flight. In the end, he transfers his life force into the dragon and dies. Fitz Chivalry however finds out that to awaken a dragon requires the Skill and the Wit used blood. So he and his bond animal a wolf succeed in waking up the remaining dragons in the garden.

So how does this book relate to bringing ideas to life? In a lot of ways. The characters in this book had to act despite not knowing all the details. When Verity left home to carve his dragon, he had no idea how to go about it. With no teacher or mentor, a lot of mistakes where made. To try and save his life, Verity even asked Fitz Chivalry to try to awaken the dragon and even he did not know! Only after an accident when an assailant died on a dragon did he realize how to awaken a dragon. By that time, Verity had died!

In making his dragon, Verity had died. By accident, a dragon had been awakened! The truth is there is no “right” way to do anything in a new and emerging field. There will be plenty of “accidents” along the way. But by committing to the mission and acting despite doubt, the odds of success increase. That for me is how ideas are brought to life. In closing this post, I will end with a quote from Johann Wolfgang Von Goethe. I call it the Magic of Commitment. With this magic, ideas can be brought to life!

“Until one is committed, there is hesitancy, the chance to draw back, always ineffectiveness. Concerning all acts of initiative (and creation), there is one elementary truth the ignorance of which kills countless ideas and splendid plans. The moment one definitely commits oneself, then providence moves too. All sorts of things occur to help one that would never otherwise have occurred. A whole stream of events issues from the decision, raising in one’s favor all manner of unforeseen incidents and meetings and material assistance, which no man could have dreamed would have come his way. Whatever you can do, or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.”