How to resolve the algorithm Pinstripe/Display step by step in the PicoLisp programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Pinstripe/Display step by step in the PicoLisp programming language

Table of Contents

Problem Statement

The task is to demonstrate the creation of a series of vertical pinstripes across the entire width of the display.

c.f. Colour_pinstripe/Display

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Pinstripe/Display step by step in the PicoLisp programming language

Source code in the picolisp programming language

(let Pbm  # Create PBM of 384 x 288 pixels
   (make
      (for N 4
         (let
            (C 0
               L (make
                  (do (/ 384 N)
                     (do N (link C))
                     (setq C (x| 1 C)) ) ) )
            (do 72 (link L)) ) ) )
   (out '(display)  # Pipe to ImageMagick
      (prinl "P1")
      (prinl (length (car Pbm)) " " (length Pbm))
      (mapc prinl Pbm) ) )

  

You may also check:How to resolve the algorithm Higher-order functions step by step in the Wren programming language
You may also check:How to resolve the algorithm Ternary logic step by step in the Seed7 programming language
You may also check:How to resolve the algorithm Erdös-Selfridge categorization of primes step by step in the Java programming language
You may also check:How to resolve the algorithm Curzon numbers step by step in the Arturo programming language
You may also check:How to resolve the algorithm Currying step by step in the Scala programming language