D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Return to .... BASIC ...

 

On 15/03/12 08:55, Gordon Henderson wrote:

So my little project that I've been playing with since the new year was
on-show at the LUG meet last Saturday...

And it's a BASIC interpreter...

I know, I know... why, etc. because it's there... It's a personal
project that I want to share with anyone who's interested.

Started off by wanting to get a 32 year old BASIC program going again in
C, so initially I was going to hand re-code the 3000 or so lines it in
C, but I thought what the heck, lets write a new BASIC. So I have.

So while it does use line numbers (as all good BASICS do!), it can be
programmed without them if you use an external editor and don't use goto
or gosub... (and I may yet build a simple editor in) It's got most of
the nice stuff in modern structured language while/until, named
procedures & functions, recursion, local variables as well as some
graphics - fairly plain old 2D stuff, low and high resolution as well as
"turtle" graphics which are fun to play with. (well, I think so!)

http://unicorn.drogon.net/rtb1.png

I'm thinking of adding in sound of some sort (don't know what, yet), and
some sort of "sprite" handling - but I'm not really intending for it to
be some general purpose thing for people to write the next big
financial, maths, simulation, etc. app in like what we used to do, more
something just for a bit of fun.... (but hey, I'm not going to stop
anyone!)


Then there's this Raspberry Pi thing, and while it wasn't actually in my
mind when I kicked this off, I'm now thinking I'll produce a turn-key
system for it that boots directly into RTB (for that's what I've called
it) and so I've started to write a teaching/reference manual for it too.
I know the RPi folks are dedicated to Python, but it's always nice to
have choice (and BASIC didn't do me any harm ;-) I've successfully
compiled it in an QEmu system running the RPi Debian image and although
it's a bit slow on my workstation (1.75GHz Athlon!) it does work an is
very usable.

So does anyone fancy having a play with it? There's a few bugs I need to
iron out and I'd be keen to get some feed back and suggestions for
features, etc.

I'll GPL the source code eventually, but not for now.

Let me know if anyones interested and I'll put a package together. It
uses the SDL libraries, so if you can run any SDL program (e.g.
tuxpaint) then this ought to run, but I know there are issues running
binaries over multiple distros, etc. although I'll look at a statically
compiled version if if gives issues. It's compiled under Debian Squeeze
and runs on Lenny OK, so I don't see any problems with it running under
Ubuntu...


Back to my 32 year old BASIC program - well, I went out and bought a
real Apple II and got it going and my 32 year old 5.25" floppys are
still readable. All I need now is a serial card to transfer the program
over as I really don't fancy typing in 3000 lines of BASIC!!!

http://unicorn.drogon.net/lode.jpg

(that's not my program, but an old game I used to play!)

I'll put up some more over the weekend, a bit busy with other "stuff"
today & tomorow )-: and I need to do more work on the manual as my
writing style is somewhat creative...

Of anyone wants a quick preview, open an xterm and:

wget http://unicorn.drogon.net/rtb.tar -O - | tar xfB -
cd rtb
./rtb

(it's 104KB, so not going to break your ADSL allowance!)

If you can run tuxpaint, then this ought to run too as it uses the same
libraries, but if it doesn't run, please let me know.

It ought to pop open a 640x420 window which you can type into.. Try this:

load turtl3
run

There are some simple programs included then use the dir and load
commands to find and load then & type run to run them (don't add the
.rtb when using the load command)

If you want it full-screen, then try

./rtb -f d

which will list the modes avalable on your display, then

./rtb -f -m 0

where 0 is the mode/size you want from that list. It defaults to
640x480. The screen font is 8x8 and might be a bit small on the higher
resolutions.

(the exit command will get you out of rtb back to normal without having
to kill it!)

If you write some of your own stuff, one thing to look out for is a bug
in the parser to do with handling minus calculations - this will be
parsed incorrectly: a=colour-1 but this will work fine: a=colour - 1 so
use plenty of spaces, but I'd appreciate fedback on any other bugs or
oddities you find!

Enjoy,

Gordon



Hi Gordon,

The demo you gave us and the walk through of some of the code was the most impressive thing i have seen in a long long long time! lol. So well done!!! It's very cool :-)

Not sure I have the skill/time to play around with it to any large degree - but maybe..... :-)

Best wishes
roly :-)

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq