Yesterday when I was traveling back to Amsterdam I suddenly a very nice idea for a series of articles here on my weblog.
As many know I am a software engineer (or a programmer as they called that in the past :P). In the more then the 20 years I am coding I have seen many programming languages. It should be fun for me to take a look back at them all and maybe it is also nice for those who have an interest in this area. So every now and then I will give one of the languages I have worked or am working with some special attention.
I will start with a review of ZX 81 Basic. The ZX 81 was one of the first home computers that came out in the early 1980’s. It had a build in Basic version.
Basic (Beginners All-purpose Symbolic Instruction Code) was not really meant to develop in, but it was meant to learn programming. Most Basic-versions were interpreter language, which meant on execution of the program the original source was translated to system instruction (commands that a computer can understand and execute).
ZX 81 Basic was a very minimal version of Basic. The instruction set is very limited.
Interesting was though that while you where enter code, ZX 81 Basic completed the instruction for you. So when you entered an “I’ it knew when you meant just an “I” or you needed the “if” instruction and display the complete instruction on the screen. It did this pretty good.
ZX81 Basic did not have any really graphic functions. After all it was complete black/white and the only way to do anything with plotting small blocks on the screen.
Below a typical example of piece of ZX81 Basic code. Looking at it, I would have done some thing different, but as said…. “Code is Poetry” , so it is all up to the coder :
1000 REM recursive subroutine
1010 IF x>8 OR x<1 OR y>8 OR y<1 THEN RETURN
1020 IF b$(s,1)<>a$(y,x) THEN RETURN
1030 IF SCREEN$ (20-y*2,2+x*3)<>” ” THEN RETURN
1040 PRINT AT 20-y*2,1+x*3; PAPER 5+((y+x)=INT ((y+x)/2)*2);(” ” AND s<10); s
1050 IF s=64 THEN PRINT AT 21,8;”SOLVED IN “;m; ” MOVES” : STOP
1060 LET s=s+1: LET b$(s)=”23456789″: LET m=m+1
1070 LET x=x+x2: LET y=y+y1: GO SUB 1000: LET y=y-y1: LET x=x-x2
1080 LET x=x+x2: LET y=y-y1: GO SUB 1000: LET y=y+y1: LET x=x-x2
1090 LET x=x+x1: LET y=y+y2: GO SUB 1000: LET y=y-y2: LET x=x-x1
1100 LET x=x+x1: LET y=y-y2: GO SUB 1000: LET y=y+y2: LET x=x-x1
1110 LET x=x-x1: LET y=y+y2: GO SUB 1000: LET y=y-y2: LET x=x+x1
1120 LET x=x-x1: LET y=y-y2: GO SUB 1000: LET y=y+y2: LET x=x+x1
1130 LET x=x-x2: LET y=y+y1: GO SUB 1000: LET y=y-y1: LET x=x+x2
1140 LET x=x-x2: LET y=y-y1: GO SUB 1000: LET y=y+y1: LET x=x+x2
1150 IF b$(s)>=”0″ THEN LET b$(s)=b$(s,2 TO ): GO TO 1070
1155 LET s=s-1 : REM obsolete backtracking path
1160 PRINT AT 20-y*2,1+x*3; PAPER 8;” “
Edit: Somehow the code example was messed up. There were some codes in there that were translated as HTML, which it should not. It looks now a lot better I have to say.
11 comments to this article, press "Continue Reading" to view them or to add a commment.