How to resolve the algorithm Munching squares step by step in the Action! programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Munching squares step by step in the Action! programming language

Table of Contents

Problem Statement

Render a graphical pattern where each pixel is colored by the value of 'x xor y' from an arbitrary color table.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Munching squares step by step in the Action! programming language

Source code in the action! programming language

PROC PutBigPixel(BYTE x,y,c)
  BYTE i

  Color=c
  x=x*3+16
  y=y*12
  FOR i=0 TO 11
  DO
    Plot(x,y+i)
    DrawTo(x+2,y+i)
  OD
RETURN

PROC Main()
  BYTE
    CH=$02FC, ;Internal hardware value for last key pressed
    x,y

  Graphics(9)

  FOR y=0 TO 15
  DO
    FOR x=0 TO 15
    DO
      PutBigPixel(x,y,x!y)
    OD
  OD

  DO UNTIL CH#$FF OD
  CH=$FF
RETURN

  

You may also check:How to resolve the algorithm 100 doors step by step in the Perl programming language
You may also check:How to resolve the algorithm QR decomposition step by step in the Racket programming language
You may also check:How to resolve the algorithm Runtime evaluation/In an environment step by step in the AppleScript programming language
You may also check:How to resolve the algorithm Loops/Do-while step by step in the Suneido programming language
You may also check:How to resolve the algorithm Arithmetic-geometric mean step by step in the PARI/GP programming language