Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 18, 2020 01:08 pm GMT

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 keypressedEND.

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?


Original Link: https://dev.to/rogerzanoni/what-s-the-oldest-code-you-have-stored-4gk2

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To