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

Published on 12 May 2024 09:40 PM

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

Table of Contents

Problem Statement

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

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Sierpinski square 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          ( $ --> $ )
 
  [ $ "F" ]                      is F          ( $ --> $ )
 
  [ $ "AFRFLFRAFLFLAFRFLFRA" ]   is A          ( $ --> $ )
 
  $ "FLAFLFLAF"
  
  4 times expand
  
  turtle
  10 frames
  witheach
    [ switch
        [ char L case [ -1 4 turn ]
          char R case [  1 4 turn ]
          char F case [  5 1 walk ] 
          otherwise ( ignore ) ] ]
  1 frames

  

You may also check:How to resolve the algorithm Gray code step by step in the Verilog programming language
You may also check:How to resolve the algorithm Leap year step by step in the Fermat programming language
You may also check:How to resolve the algorithm Towers of Hanoi step by step in the Gambas programming language
You may also check:How to resolve the algorithm Symmetric difference step by step in the Delphi programming language
You may also check:How to resolve the algorithm Priority queue step by step in the Arturo programming language