What's the oldest code you have?

rogerzanoni

Roger Zanoni

Posted on March 18, 2020

What's the oldest code you have?

Some time ago a friend sent me a backup of our code from when we were starting to learn pascal. It was very nice to see some of my first attempts at programming.

This one is from November of 2004, it's not the first thing I coded but it's the oldest backup I have:

program cor;

uses crt;

var x,y :byte;
i:byte;

BEGIN
    randomize;
    repeat
        y:=random(45);
        if y = 0 then begin
            y:=1
        end;

        repeat
            x:=random(80);
        until x <> 0;

        i:=random(10);
        gotoxy(x,y); textcolor(i); write('Û');
    until keypressed
END.
Enter fullscreen mode Exit fullscreen mode

It's a small loop to print small colored blocks in the console ("cor" means "color" in portuguese); It's written in pascal to run in DOS and looks like this running in DOSBox:

COR.PAS

I created a gist with all my old sources sources so I don't lose them again. No indenting as I wasn't even aware of what this "indenting" thing was.

Looks like I was pretty "visual" when I started learning, creating small samples to work with colors in DOS and trying to make small games like this small (and broken) Tower of Hanoi implementation (I named it with an "Y" in the original file), it's probably the first game I tried to code:

Hanoi

What about you? What's the oldest thing you have stored or remember you did?

💖 💪 🙅 🚩
rogerzanoni
Roger Zanoni

Posted on March 18, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What's the oldest code you have?
firstpost What's the oldest code you have?

March 18, 2020