My first lines of Pascal code in about 5 years. Huh... it's like learning to ride the bike again :)
I don't really know what got into me when I installed FreePascal - the open source compiler... I wrote a few lines of code in notepad++ and as I saved it with ".pas" the program recognized Pascal code.
You know, Pascal code is like a vintage brand for many wannabe programmers. Including me :).
Not that you would be very interested in compiling the code, but here is its text version:
program comeback; // name of program
uses
crt; // tells compiler to include basic functions for CRT monitors.
var
key: string; // defines variable for typed keys
t: integer; // defines variable for counting
begin // begins program
t:=1;
clrscr; // clears the screen
writeln('Hello world!'); // writeln - writes a new line
repeat
writeln('Try nr. ',t);
writeln('Type "a"');
readln(key); //readln - reads keys in a new line
if (key='a') OR (key='A') then writeln('Thank you! Bye!')
else
begin
writeln('Wrong key(s). But, hey, thank you. Try again!');
t:=t+1;
end;
until (key='a') or (key='A');
writeln ('Press any key to exit');
readln; //equivalent of "press any key to exit" :)
end. // ends program
Labels: computer, general