How to resolve the algorithm Sierpinski triangle/Graphical step by step in the J programming language

Published on 12 May 2024 09:40 PM
#J

How to resolve the algorithm Sierpinski triangle/Graphical step by step in the J programming language

Table of Contents

Problem Statement

Produce a graphical representation of a Sierpinski triangle of order N in any orientation.
An example of Sierpinski's triangle (order = 8) looks like this:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Sierpinski triangle/Graphical step by step in the J programming language

Source code in the j programming language

   load 'viewmat'
   'rgb'viewmat--. |. (~:_1&|.)^:(<@#) (2^8){.1


load'viewmat'
viewmat(,~,.~)^:4,1


viewmat #:(~:/&.#:@, +:)^:(<32) 1


  

You may also check:How to resolve the algorithm Find the intersection of two lines step by step in the zkl programming language
You may also check:How to resolve the algorithm Safe addition step by step in the Ada programming language
You may also check:How to resolve the algorithm Spinning rod animation/Text step by step in the Perl programming language
You may also check:How to resolve the algorithm Environment variables step by step in the BASIC programming language
You may also check:How to resolve the algorithm Fast Fourier transform step by step in the Klong programming language