How to resolve the algorithm Colour pinstripe/Display step by step in the SmileBASIC programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Colour pinstripe/Display step by step in the SmileBASIC programming language

Table of Contents

Problem Statement

The task is to create 1 pixel wide coloured vertical pinstripes with a sufficient number of pinstripes to span the entire width of the graphics display.

The pinstripes should either follow the system palette sequence,   or a sequence that includes: black,   red,   green,   blue,   magenta,   cyan,   yellow,   and   white:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Colour pinstripe/Display step by step in the SmileBASIC programming language

Source code in the smilebasic programming language

FOR I=1 TO 4
 COLIDX=0
 YTOP=(I-1)*60
 FOR X=0 TO 399 STEP I
  IF COLIDX MOD 8==0 THEN
   RESTORE @COLOURS
  ENDIF
  READ R,G,B
  GFILL X,YTOP,X+I,YTOP+59,RGB(R,G,B)
  INC COLIDX
 NEXT
NEXT

@COLOURS
DATA 0,0,0
DATA 255,0,0
DATA 0,255,0
DATA 0,0,255
DATA 255,0,255
DATA 0,255,255
DATA 255,255,0
DATA 255,255,255

  

You may also check:How to resolve the algorithm Integer comparison step by step in the LLVM programming language
You may also check:How to resolve the algorithm Trabb Pardo–Knuth algorithm step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm Increment a numerical string step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm URL decoding step by step in the VBScript programming language
You may also check:How to resolve the algorithm Fibonacci n-step number sequences step by step in the Pascal programming language