Post Reply 
What Was Your First Programming Language?
07-08-2015, 02:14 AM
Post: #70
RE: What Was Your First Programming Language?
(07-08-2015 01:30 AM)Bill (Smithville NJ) Wrote:  Remembering Pilot reminded me of another language - LOGO with Turtle Graphics. There were quite a few implantations of LOGO and also some "Turtle Robots" to actually do the drawing on paper.

Indeed - I remember DRI's "Dr Logo"; I had it but didn't do anything with it, really, as it booted from floppy and ran stand-alone, rather than on top of CP/M or MS-DOS.

While I'm dredging out old code, here's a PL/I Subset G version of that guessing game:

Code:

guess:
    procedure options (main);

    /*
    Guessing Game Version 2.1
    Programmed in PL/I
    7/21/84
    */

    dcl seed fixed decimal (12,10);
    dcl (guess,number) fixed binary (7);
    dcl name char (20) varying;
    dcl play char (4);

    put list ('Hi there, what''s your name?');
    get list (name);
    put skip list ('OK',name,', do you want to play a guessing game?');
    get list (play);
    seed = 0.987654321;
    do while (substr(play,1,1) = 'Y' | substr(play,1,1) = 'y');
        seed = 29 * seed - floor(29 * seed);
        number = floor (99 * seed + 1);
        put skip list ('I''m thinking of a number between 1 and 100.');
        put skip list ('You''ve got to try to guess it');
        put skip list ('What''s your guess?');
        get list (guess);
        do while (guess ~= number);
            if guess > number then put list ('Too high!');
            if guess < number then put list ('Too low!');
            put skip list ('What''s your guess?');
            get list (guess);
        end;
        put list ('You''ve got it,',name,'!!!');
        put skip list ('Play again?');
        get list (play);
    end;
end guess;

--- Les
[http://www.lesbell.com.au]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: What Was Your First Programming Language? - Les Bell - 07-08-2015 02:14 AM



User(s) browsing this thread: 2 Guest(s)