Lease this WebApp and get rid of the ads.
Programming the Spectrum is fun
Sat May 12, 2018 11:53

Every once in a while I decide to try and tackle a problem by myself, usually something simple like getting a blob to move smoothly from left to right and keep on doing so.

This would be a pain in the arse with most Basic's but the joy of the Spectrum is in its really easy to use dialect of Basic plus its really good error trapping routine and last but not least the single keypress keyword entry which many find infuriating but I love.

Its all too easy to make a single character spelling error with entering long lines of keywords and especially the crucial punctuation which in Basic performs much more important jobs than simple sentences. Once you've learned the trick to being in the correct mode - the cursor changes to tell you about what mode you're in - single keyword entry is fast and foolproof.

Richard Altwasser or Nine Tiles Software deserve a lot more recognition than they got for their implementation of TinyBasic especially when you consider Clive Sinclairs parsimonious approach and chiselling all who developed his concept into a workable machine.

He'd have liked me though. I'm the odd 1% that uses his computer the way he meant it to be used. He never liked the computer gaming side of things and hoped the Spectrum would be chosen by the BBC and the education market to introduce beginners to programming.

Sometimes I'll see a challenge at WoS such as the eternal search for a truly random number generator - I dont know why they agonize about this so much because the RND function works well enough- and it will intrigue me enough to have a go.

Not being either a mathematician or a 'real' programmer, I tend to look at problems in a different way. So my idea was to program an onscreen display of three single digit numbers rotating like the windows of a fruit machine or one armed bandit. You have to push a button to stop each wheel and the final display is your random number. The way I see it, the human operator is what introduces the random factor.

This was just a simple demo, if I wanted to do it seriously I would allow say 0 to 99 per wheel although in the short run of my test program I didnt get the same result twice.
I dont know how to calculate the number of variations possible from the 3 row single digit system but I suspect it might be larger than expected.

Well I got my moving blob working smoothly yesterday after several hours of trial and error and having to add necessary features I'd overlooked, like a STOP button! Now I'm going to expand it to 2x3 thats 3 blobs above or below another 3 blobs to form a rectangular solid.

Then I'll design special characters to go in place of the blobs so that combined they look like a tank perhaps or maybe a plane. After that - if I havent given up yet - I'll make scenery for it to fly over. I doubt if I'll get that far but saving each separate program means I have built up a suite of tools I can use for other software projects.

    • I had a Marie Celeste experience! - Mike, Thu May 17 10:15
      I wrote a short test program to display the animated graphic of a tank with its tracks moving. Took me half a day to program the UDG characters which consisted of 8 lines of Basic to draw the tank... more
      • Re: I had a Marie Celeste experience! - roger, Fri May 18 12:36
        I do not know much about computers.I'm lucky to do anything. This past nine days my computer decided that i would be allowed to see and read some e-mail, but not all, and not answer or use links on... more
      • Sounds like.... - Goose, Thu May 17 11:39
        ...a good way to keep the brain active. Supposedly, working puzzles (what programming is, pretty much) keeps the brain alive. I haven't done this except for playing free cell, but that's pretty dumb. ... more
        • Dont let it happen - mike, Thu May 17 21:09
          I notice a slight dimunition in my mental faculties, hardly more than a few short term memory losses, the worst being the whether or not I took my meds problem. Dont give in, never surrender! I cant... more
    • Had to ask the wife what a Spectrum was - Goose, Tue May 15 11:00
      She said they were obsolete so long ago, she doesn't recall much about 'em, though she worked with 'em for a while. She's like me, started programming in the punch card era on main frames. She even... more
    • Its the ingenuity that appeals to me - mike, Sun May 13 10:11
      Unfortunately (or perhaps from your point of view, fortunately) I cannot display the images necessary to show what I'm on about but never mind it doesnt really matter. If you ever turned the handle... more
      • I understand the illusion of movement - Goose, Thu May 24 17:50
        It's done with loops and adding to variables in the loop for the next print. I wrote a "ski slalom" program once that did a similar thing with a skier skiing between markers. The markers of the... more
        • You ought to have a go too! - mike, Thu May 24 20:14
          Because I could use someone to bounce ideas off of. I would suggest you download Fuse - I know I put a link up to it but I can always do it again if you would like. FUSE... more
  • Click here to receive daily updates