How to resolve the algorithm Sierpinski arrowhead curve step by step in the Quackery programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Sierpinski arrowhead curve step by step in the Quackery programming language

Table of Contents

Problem Statement

Produce a graphical or ASCII-art representation of a  Sierpinski arrowhead curve  of at least order  3.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Sierpinski arrowhead curve step by step in the Quackery programming language

Source code in the quackery programming language

  [ $ "turtleduck.qky" loadfile ] now!
 
  [ stack ]                      is switch.arg (   --> [ )
  
  [ switch.arg put ]             is switch     ( x -->   )
 
  [ switch.arg release ]         is otherwise  (   -->   )
 
  [ switch.arg share 
    != iff ]else[ done  
    otherwise ]'[ do ]done[ ]    is case       ( x -->   )
  
  [ $ "" swap witheach 
      [ nested quackery join ] ] is expand     ( $ --> $ )
    
  [ $ "L" ]                      is L          ( $ --> $ )
 
  [ $ "R" ]                      is R          ( $ --> $ )
 
  [ $ "BLALB" ]                  is A          ( $ --> $ )
 
  [ $ "ARBRA" ]                  is B          ( $ --> $ )
 
  $ "A"
  
  6 times expand
  
  turtle
  10 frames
  witheach
    [ switch
        [ char L case [ -1 6 turn ]
          char R case [  1 6 turn ]
          otherwise   [  4 1 walk ] ] ]
  1 frames

  

You may also check:How to resolve the algorithm Integer sequence step by step in the Elena programming language
You may also check:How to resolve the algorithm Jensen's Device step by step in the 11l programming language
You may also check:How to resolve the algorithm Metered concurrency step by step in the Rust programming language
You may also check:How to resolve the algorithm Draw a sphere step by step in the FutureBasic programming language
You may also check:How to resolve the algorithm Roman numerals/Encode step by step in the Fortran programming language