Graphic version of Fill description

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Graphic version of Fill description

William DesLauriers
 Runs an infinite loop that listens to the keyboard input.
 When a key is pressed (any key), the program blackens the screen,
 i.e. writes "black" in every pixel;
 the screen should remain fully black as long as the key is pressed. 
 When no key is pressed, the program clears the screen, i.e. writes
"white" in every pixel;
 the screen should remain fully clear as long as no key is pressed.

Based upon the Fill's description, I draw the flowchart.  Am I reading it right?
Fill Flowchart
At this time, I am using the Windows 10's paint program to create this kind of the flowchart.

Thanks,
Wm
Reply | Threaded
Open this post in threaded view
|

Re: Graphic version of Fill description

cadet1620
Administrator
The easiest way to write Fill is to check the keyboard in the loop:
pointer = SCREEN
forever
{
    if key pressed then
        RAM[pointer] = black
    else
        RAM[pointer] = white

    pointer = pointer+1
    if pointer >= SCREEN+8192 then
        pointer = SCREEN
}
I just did a quick Google search. You might want to check out
    https://www.draw.io/
for flowcharting. No guarantees; I haven't used it.

--Mark