Sunday 24 May 2009

recommended software to get started with...

There are still a few people developing new software for the standard (non-multitasking) TOS.

Firstly, desktop replacements: I found teradesk and I like it. It is available from
here.

I found an editor which is specifically for html. Only I like to program so I'm using it as a normal text editor too. Its called Joe. There are a few other programs available from this page, they all seem to be free and the author seems to be a bit of a fan of GFA basic. Get it from here.

And finally, I wanted to get perl for the Atari. The latest version that I see that runs with TOS is version 4, and these are found in the form of zoo archives. Pain in the neck...
Anyway the Perl files I found were:
perl4_10.zoo (252kb)
perl_419.zoo (191kb)

Then the zoo archive program was zoo21.lzh

And to unpack the zoo program I used winrar (boo.. hiss..)

So, once I had ZOO.TTP and readme.st, it was just a matter of typing in the correct command line. Which turned out to be a right pain because I couldn't find the forward slash key..
In Teradesk, I ran Zoo.ttp and entered 'x C:/ATARI/perl_419.zoo'
and hey presto, it all unpacked.

Perl 4 is not as cool as later versions of perl and perhaps there's a 'command line' for the ST that would make error messages stay on-screen for longer, but any bugs in my perl didn't seem to be usefully reported to the screen. After a lot of trial and error, I wrote a working prime number generator..

@primes = (2);

$t_s = time;
for ($i = 3; $i < 35000; $i = $i+2) {
$sqrt_i = sqrt($i);
$prime = 1;
foreach $k (@primes) {
if ( 0== $i%$k) {
$prime = 0;
# print " $i is divisible by $k \n";
last;
} elsif ($k > $sqrt_i) {
last;
}
}
if ($prime) {
push (@primes, $i);
}
}
$t_e = time;

The two biggest bugs were:
'push @primes, $i;' -- didn't work because you need brackets for push.
'if ($i%$k) {' -- didn't work because that wasn't the correct test..
'if (not $i%$k) {' -- should have worked, but seems perl 4 doesn't work like that.

So that's plenty enough for one day...

1 comment:

  1. It looks like I'd benefit from locating Gulam, described as a command line shell for the ST. So on some ftp server I might find the following files:

    gulam.lzh Gulam command line interpreter
    gulamdoc.lzh Docs for Gulam
    gulaminf.lzh Info of Gulam

    Update.. Available from:

    ftp://nic.funet.fi/pub/atari/sysutil/gulam.lzh

    ReplyDelete