A while back, digging into an old DO NOT DELETE backup folder in one of my old hard drives, I stumped upon a folder called parchis, and for a moment I held my breath until I found some *.bas files there!

So what?

Well, I just found the lost source code of my very first project, the one I coded while learning about variables, procedures and loops, the one that made me realize that this is the kind of stuff I wanted to do as my professional career and hobby.

The one that made me love coding.

But before explaining further, let me explain what the Parchís game is about, and for that I’m going to borrow the definition from the Wikipedia:

Parchís is a Spanish board game of the Cross and Circle family. It is an adaptation of the Indian game Pachisi. Parchís was a very popular game in Spain at one point as well as in Europe and north Morocco - specifically Tangiers and Tetouan, and it is still popular specially among adults and seniors. Since it uses dice, Parchís is not usually regarded as an abstract strategy game like checkers or chess. It does not depend entirely on luck either, since the four pawns under a player’s command demand some sort of strategy.

So here I am, 17 years old me, learning how to code from a book I borrowed from the library about QuickBasic. Yep, back then Internet was not a thing yet (at least not much yet in Spain), so that was how we used to browse and learn new topics, by going to a library. And, oh did I enjoy it.

Parchis in QuickBasic

I still don’t know what exactly hooked me up, but there I was writing this weird mixed of English & Spanish that the computer was able to understand, using this archaic environment in MS-DOS. Maybe it was being able to finally understand how games were made, or the beauty of taking a problem and plan and design a solution, and not only that, taking care of the solution being elegant and simple. Pure beauty.

But anyway, after a few weeks (if I remember correctly), I managed to put something together that resembled the game I was aiming for and that kind of worked. To be honest, trying to read the code today is quite painful, and hard to keep all the logic and structure in your head, which makes me even prouder of being able of making it work being so poorly written.

This is how the program looks like:

Parchis - Daniel Pecos - 1998

And no, the screenshot is not from back then, but from a couple of days ago, when I found the source code. I wanted to check if it was possible to still run that code, so I started digging about modern quick basic interpreters, and found some, but at the end the best solution was to use dosbox, a MS-DOS emulator and installing QuickBasic 4.5 to open the software.

And lo and behold, it worked!

(BTW, I use Arch, and this is running on Arch Linux)

I’ve put all the code together in a Github repository, where I’ve fixed some MS-DOS encoding issues and cleaned a little bit the code, but I’ve kept all the original comments, bugs and code smells that I wrote back then. There are some instructions on how to get it running, just in case you are interested on running old QuickBasic programs.

I don’t want to change a single bit of it, but I want to be able to look at it from time to time and remember how all of this started.

If you’d like to have a look, feel free, although I doubt you’ll find any value on the code itself, it’s ugly, poorly written, anb barely works, but to me :-)

https://github.com/dpecos/parchis

And if you’d like to actually see how I got it up and running, here you have a small screencast of the process and gameplay:

Last but not least, I have to say that it was my friend Alfredo who actually introduced me to software development, showing me a couple of small programs he was developing to learn QuickBasic, and triggering my curiosity about it, leading towards this project.

So basically all of this is his fault. Thx for that Alfredo ;-)