modes and plot codes

Discuss all aspects of programming here. From 8-bit through to modern architectures.
Post Reply
User avatar
richmond62
Posts: 213
Joined: Sun Apr 16, 2017 3:15 pm
Location: Bulgaria
Contact:

modes and plot codes

Post by richmond62 » Sun May 14, 2017 7:34 am

I am trying to plot a simple SINE curve in BBC BASIC (no, I'm not so moronic
that I cannot work out the code for that), and do NOT want the end result to
look like the blips on a Geiger counter, but a solid line.

I have been wading (knee deep) through the MODEs and
the endless PLOT display codes with no result.

This, for instance, yielding nothing but a moving dot:

55 MODE 4
60 PLOT 69,CA,SA


I would be most grateful for some advice.

dp11
Posts: 797
Joined: Sun Aug 12, 2012 8:47 pm
Contact:

Re: modes and plot codes

Post by dp11 » Sun May 14, 2017 7:50 am

Post your full code please.

I suspect your mode 4 command should be once at the top of your code and not in the loop.

User avatar
richmond62
Posts: 213
Joined: Sun Apr 16, 2017 3:15 pm
Location: Bulgaria
Contact:

Re: modes and plot codes

Post by richmond62 » Sun May 14, 2017 8:51 am

Screen Shot 2017-05-14 at 11.50.40 am.png

User avatar
jgharston
Posts: 3057
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: modes and plot codes

Post by jgharston » Sun May 14, 2017 9:04 am

richmond62 wrote:Screen Shot 2017-05-14 at 11.50.40 am.png
Yes, that's gonig to clear the screen every time you go around the loop.
PLOT action codes

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
flaxcottage
Posts: 3067
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: modes and plot codes

Post by flaxcottage » Sun May 14, 2017 9:06 am

Yep, make line 10 MODE4 and delete line 60.

This will produce a curve using dots.

To get a curve using very short straight lines use the following code;
cosine.jpg
Changing the value in V will alter the amplitude.
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
richmond62
Posts: 213
Joined: Sun Apr 16, 2017 3:15 pm
Location: Bulgaria
Contact:

Re: modes and plot codes

Post by richmond62 » Sun May 14, 2017 9:12 am

Screen Shot 2017-05-14 at 12.11.22 pm.png
Thank you very much for your help.

I switched SA and CA round as the thing looked bl**dy silly the other way :wink:
Last edited by richmond62 on Sun May 14, 2017 9:14 am, edited 1 time in total.

User avatar
danielj
Posts: 6173
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: modes and plot codes

Post by danielj » Sun May 14, 2017 9:13 am

You can also ditch the CLS and CLG and the LET keyword if you like :) it'll still work fine.

d.

User avatar
richmond62
Posts: 213
Joined: Sun Apr 16, 2017 3:15 pm
Location: Bulgaria
Contact:

Re: modes and plot codes

Post by richmond62 » Sun May 14, 2017 9:17 am

I'll ditch the LET on my BBC Master, but I'm not entirely sure if ALL BBC BASIC allows one to drop the LET statement,
and Richard Bannister's HORIZON does NOT emulate a Compact.

I learnt BASIC 4 initially (Hollerith cards in the post to Imperial College), and then something called DBAS 9
on a Research Machine; hence the slightly backward-looking LET statements.

The CLS and the CLG are neither here nor there, just something ingrained from the murky past (1976).

User avatar
danielj
Posts: 6173
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: modes and plot codes

Post by danielj » Sun May 14, 2017 9:32 am

Even v1 doesn't require LET :)

d.

User avatar
richmond62
Posts: 213
Joined: Sun Apr 16, 2017 3:15 pm
Location: Bulgaria
Contact:

Re: modes and plot codes

Post by richmond62 » Sun May 14, 2017 9:40 am

So why did "Bonehead" Barker, our Maths teacher and the man who turned me onto computer programming, make a BIG thing about LET statements?

User avatar
danielj
Posts: 6173
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: modes and plot codes

Post by danielj » Sun May 14, 2017 9:54 am

Probably because he didn't know what he was on about :D

d.

User avatar
jgharston
Posts: 3057
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: modes and plot codes

Post by jgharston » Sun May 14, 2017 10:14 am

richmond62 wrote:I'll ditch the LET on my BBC Master, but I'm not entirely sure if ALL BBC BASIC allows one to drop the LET statement
ALL BBC BASICs omit LET, it's in the specification.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
richmond62
Posts: 213
Joined: Sun Apr 16, 2017 3:15 pm
Location: Bulgaria
Contact:

Re: modes and plot codes

Post by richmond62 » Sun May 14, 2017 10:37 am

Probably because he didn't know what he was on about
Or, maybe because he was NOT teaching us BBC BASIC :)
380z_computer.jpg
380z_computer.jpg (25.06 KiB) Viewed 260 times
This is a bit creepy: http://teachersinstitute.yale.edu/curri ... .09.x.html

User avatar
BeebMaster
Posts: 2537
Joined: Sun Aug 02, 2009 4:59 pm
Location: Lost in the BeebVault!
Contact:

Re: modes and plot codes

Post by BeebMaster » Sun May 14, 2017 7:52 pm

Also in BBC BASIC in a FOR...NEXT loop you can omit the variable in the NEXT statement (unless you have nested loops and need to distinguish between two or more) - so you can change line 80 to just "NEXT".
Image

Post Reply