[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My First Computer (was Computing Editorial)



"Glen" <lpepicel@nycap.rr.com> wrote in message...

> I don't *need* a lot of background in education to recommend perl!  I
> can recommend it because I know that perl makes simple things easy and
> hard things possible.  Isn't this what you want?!  Simple things easy.
>
> Take a look at below:  from perl.com  This is part of an intro that is
> probably on the level a high school kid could easily get.
>
> In fact it is much longer and you can learn all without buying anything
> at all-- no software no books.
>
> See how the design is meant to be simple but powerful.  In fact the
> basic syntax is extremely similar to BASIC.  My example.
>
> ------------
> $x= 4;
> $y= "cat";
> $z= "dog";
>
> Print "The $y saw $x $zs."
>
> -------------
> Output:
> The cats saw 4 dogs.
> ------------
>
> And so that could be easier how?!

Beat's mine:
---------------------------------------
var x : byte;
    y,z : string[4];

begin
 x:=4;
 y:='cats';
 z:='dogs';
 writeln('The ',y,' saw ',x,' ',z,'.');
 writeln('Or');
 write('The ');
 write(y);
 write(' saw ');
 write(x);
 write(' ',z);
 write('.');
end.
---------------------------------------

The output is the same, however I included the 's'
on the end in the program! :-)

Ross.