Optical illusion

Here you can link to screenshots and demos etc. of programs made using BBC BASIC
Richard Russell
Posts: 662
Joined: Tue 18 Jun 2024, 09:32

Optical illusion

Post by Richard Russell »

It might not look like it, but the dark blue stripes are horizontal and parallel (the strength of the illusion may depend on your eyesight). The program will run, without modification, in Acorn's ARM BASIC V, Matrix Brandy BASIC, BBC BASIC for Windows and BBC BASIC for SDL 2.0.

Code: Select all

   10 MODE 8
   20 COLOUR 1,144,208,255
   30 COLOUR 2, 64, 64,255
   40 COLOUR 3,255,255,255
   50
   60 GCOL 1
   70 FOR X% = 46 TO 1126 STEP 216
   80   RECTANGLE FILL X%,0,106,1022
   90 NEXT
  100
  110 GCOL 2
  120 FOR Y% = 134 TO 782 STEP 216
  130   RECTANGLE FILL 0,Y%,1278,106
  140 NEXT
  150
  160 GCOL 0
  170 FOR X% = 46 TO 1234 STEP 108
  180   FOR Y% = 134 TO 890 STEP 108
  190     MOVE X%-20,Y%:MOVE BY 20,20:PLOT 113,20,-20
  200   NEXT
  210 NEXT X%
  220
  230 GCOL 3
  240 FOR R% = 0 TO 7 : Y% = 134 + 108 * R%
  250   FOR C% = 0 TO 11 : X% = 46 + 108 * C%
  260     IF (C% EOR R% EOR R% DIV 2) AND 1 THEN
  270       MOVE X%-20,Y%   :MOVE BY 10,10:PLOT 113,10,-10
  280       MOVE X%,Y%      :MOVE BY 10,10:PLOT 113,10,-10
  290     ELSE
  300       MOVE X%-10,Y%+10:MOVE BY 10,10:PLOT 113,10,-10
  310       MOVE X%-10,Y%-10:MOVE BY 10,10:PLOT 113,10,-10
  320     ENDIF
  330   NEXT
  340 NEXT R%
illusion.png
You do not have the required permissions to view the files attached to this post.
jinx100
Posts: 9
Joined: Mon 28 Apr 2025, 13:56

Re: Optical illusion

Post by jinx100 »

Quote:

Re: BBC BASIC for SDL 2.0 version 1.44a released

Post by Richard Russell » Thu 09 Apr 2026, 18:10

Richard Russell wrote: ↑Sat 28 Mar 2026, 06:05
Added tooltips to SDLIDE.bbc; if you hover the mouse over a keyword or the toolbar a brief description is displayed.

I'm a little surprised not to have received any reaction to this, I had expected it might be controversial (one reason why you can switch it off in the Options menu). Hover-over-keyword tooltips are not uncommon in other IDEs, but have not previously been implemented in any version of BBC BASIC as far as I know.

Unquote

Looks like only you can post/reply on the Announcements topic.

I like the tool tips. Often need to widen the window to see the full tip. The tip for "TIME" shows a tip for "TIME$". Still it is a handy addition.
Richard Russell
Posts: 662
Joined: Tue 18 Jun 2024, 09:32

Re: Optical illusion

Post by Richard Russell »

jinx100 wrote: Fri 10 Apr 2026, 11:07 Looks like only you can post/reply on the Announcements topic.
I didn't know that. If I was responsible for the forum's configuration I'd prefer it set so that anybody can reply, even if they can't post. If an administrator is reading this perhaps they would consider making such a change.
The tip for "TIME" shows a tip for "TIME$". Still it is a handy addition.
That's not strictly true. When TIME is used conventionally (in an expression, or to the right of an equals sign) the tooltip is correct. It's only when TIME is to the left of an equals sign (which strictly speaking you should probably never do) that it gives the wrong tooltip.
jinx100
Posts: 9
Joined: Mon 28 Apr 2025, 13:56

Re: Optical illusion

Post by jinx100 »

Thanks for the tip and the tool-tips.