Code: Select all
10 MODE 5
20 PLOT 85, RND(1000), RND(1200)
30 GCOL 0, RND(3)
Code: Select all
10 MODE 5
20 PLOT 85, RND(1000), RND(1200)
30 GCOL 0, RND(3)
Thank you. I understand nowRichard Russell wrote: ↑Sat 14 Dec 2024, 12:53 In practice there are a number of workarounds. Most programs don't actually rely on palette animation and only fail because the GCOL value is set after rather than before the graphics are plotted. In that case the solution is trivial: move the GCOL to before the plotting:Code: Select all
10 MODE 5 20 GCOL 3, RND(3) 30 PLOT 85, RND(1000), RND(1200)
The whole 'palette animation' explanation was excessive for the issue - the re-ordering of the colour-setting and pixel-setting statements was sufficient.zachnoland wrote: ↑Sat 14 Dec 2024, 13:51Thank you. I understand nowRichard Russell wrote: ↑Sat 14 Dec 2024, 12:53 In practice there are a number of workarounds. Most programs don't actually rely on palette animation and only fail because the GCOL value is set after rather than before the graphics are plotted. In that case the solution is trivial: move the GCOL to before the plotting:Code: Select all
10 MODE 5 20 GCOL 3, RND(3) 30 PLOT 85, RND(1000), RND(1200)
BBC BASIC is awesome!
Code: Select all
10 PRINT "RED"
20 COLOUR 1
Code: Select all
10 COLOUR 1
20 PRINT "RED"
Code: Select all
VDU 19,1,1,0,0,0
It was not possible to tell from the OP's original post that re-ordering alone would solve his issue. He quoted only a code snippet which, on its own, doesn't work even if re-ordered (PLOT 85 needs to be preceded by two MOVEs) so it could have been part of a program relying on palette animation.
But, of course, I do not want any of my posts to be the cause of complaint, so I have deleted it.Richard Russell wrote: ↑Sat 14 Dec 2024, 17:18 the other way is to give a sufficiently comprehensive answer that it should suffice whatever the original intention was.
It is never necessary to do that; at least quotes have preserved the pertinent information.Richard Russell wrote: ↑Sat 14 Dec 2024, 17:33But, of course, I do not want any of my posts to be the cause of complaint, so I have deleted it.Richard Russell wrote: ↑Sat 14 Dec 2024, 17:18 the other way is to give a sufficiently comprehensive answer that it should suffice whatever the original intention was.
In the versions I've experienced, the three points of the triangle (PLOT 85) are defined as the coordinates in the statement and the two previously visited - these default to the origin if not specified so the first encountered PLOT 85 draws a straight line from the origin to the specified coordinates, the second draws a triangle with one point at the origin, etc. So omitting any statements to define the initial two coordinates is merely inelegant.Richard Russell wrote: ↑Sat 14 Dec 2024, 17:18doesn't work even if re-ordered (PLOT 85 needs to be preceded by two MOVEs)
My point was that the listed code snippet was incomplete, since the intention clearly wasn't to draw just a straight line (and I doubt that a zero-thickness triangle can be guaranteed to do that in all versions of BBC BASIC anyway). As a snippet from a bigger program, I decided that not much could reliably be deduced as to the purpose of the code.
Code: Select all
10 MODE 5
15 REPEAT
20 PLOT 85, RND(1000), RND(1200)
30 GCOL 0, RND(3)
35 UNTIL FALSE
No need. My return to this forum was permitted on the condition that complaints not be received, so it's important that anybody who is unhappy makes that known. Feel free to use the 'report' button to alert the admin to my transgression.I apologise for appearing to criticise your reply