How to resolve the algorithm Cantor set step by step in the Quackery programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Cantor set step by step in the Quackery programming language

Table of Contents

Problem Statement

Draw a Cantor set.

See details at this Wikipedia webpage:   Cantor set

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Cantor set step by step in the Quackery programming language

Source code in the quackery programming language

  [ $ "" swap witheach 
      [ nested quackery join ] ] is expand (   $ --> $ )
 
  [ $ "ABA" ]                    is A      (   $ --> $ )
 
  [ $ "BBB" ]                    is B      (   $ --> $ )
  
  [ char A = iff
      [ char q ] else space
    swap of echo$ ]              is draw   ( n c --> $ )
 
  81 $ "A"
  5 times
    [ dup witheach
        [ dip over draw ]
      cr
      i if
        [ expand
          dip [ 3 / ] ] ]
  2drop

  

You may also check:How to resolve the algorithm Hilbert curve step by step in the XPL0 programming language
You may also check:How to resolve the algorithm Boolean values step by step in the Fantom programming language
You may also check:How to resolve the algorithm Feigenbaum constant calculation step by step in the C# programming language
You may also check:How to resolve the algorithm Euler's identity step by step in the RPL programming language
You may also check:How to resolve the algorithm Tokenize a string step by step in the BQN programming language