Step 3: Draw 2-1 characters ( "0") in direction 2/ →: 00 Step 2: Draw 1-1 characters ( "") in direction 4/ ↓: 0 Step 1: Draw 1 characters ( "0") in direction 6/ ←: 0 Directions:, which translates to \$\$.Length: the first input amount of 1-based Fibonacci numbers.LÅf0Ž8OS creates the following Canvas arguments: The direction to draw in, where each digit represents a certain direction:.It takes 3 arguments to draw an ASCII shape: See this 05AB1E tip of mine (section How to compress large integers?) to understand why ŽPj is 6420.Īs for some additional information about the Canvas builtin Λ: # (which is output immediately afterwards implicitly) Λ # Use the Canvas builtin with these three arguments S # Pop and convert it to a list of digits: ![]() Åf # Get the (0-based) n'th Fibonacci number for each of these values The start and direction of the spiral can also be changed by replacing ŽPjS with Ž8O for right counterclockwise ŽG~S for down counterclockwise ŽNāS for left clockwise Ƶ‘0š for up clockwise Ž9¦S for right clockwise or ŽICS for down clockwise ( up counterclockwise is the only one that's a byte longer with Ž2„0š).Įxplanation: L # Push a list in the range Input \$n=0\$ will always draw a single character instead of an empty output.ĭraws with character 0, but this could alternatively be any other digit, the lowercase alphabet, the input digits, the digits of the 0-based \$n^\$ Fibonacci number, etc. % which means that only the top of the stack is displayedĠ-based and the spiral goes counterclockwise starting towards the left, similar as the example in the challenge. This causes the function to use only one input,
0 Comments
Leave a Reply. |