How to resolve the algorithm Colour bars/Display step by step in the M2000 Interpreter programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Colour bars/Display step by step in the M2000 Interpreter programming language
Table of Contents
Problem Statement
Display a series of vertical color bars across the width of the display. The color bars should either use:
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Colour bars/Display step by step in the M2000 Interpreter programming language
Source code in the m2000 programming language
Module Checkit {
Module Bars {
barwidth=x.twips div 8
barheight=y.twips
barcolors=(0,#ff0000,#00ff00, #0000ff, #FF00FF, #00ffff, #ffff00, #ffffff)
For i=0 to 7
Move i*barwidth, 0
\\ gradient fill. Here second color are the same as first color
Fill barwidth, barheight, array(barcolors, i), array(barcolors, i)
Next i
}
\\ first draw on console
Call Bars
Declare Form1 Form
Layer Form1 {
window 12, 10000,8000;
\\ now draw on Form1 layer, above console, in a window
Call Bars
}
Method Form1, "Show", 1 ' open modal
Declare Form1 Nothing
}
Checkit
You may also check:How to resolve the algorithm Hello world/Newline omission step by step in the Erlang programming language
You may also check:How to resolve the algorithm Doubly-linked list/Definition step by step in the FreeBASIC programming language
You may also check:How to resolve the algorithm Bitmap/PPM conversion through a pipe step by step in the C programming language
You may also check:How to resolve the algorithm 24 game step by step in the Phix programming language
You may also check:How to resolve the algorithm Map range step by step in the Frink programming language