Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Post History

66%
+2 −0
Sandbox Fibonascii Squares [FINALIZED]

posted 6mo ago by Sylvester‭  ·  edited 6mo ago by trichoplax‭

#5: Post edited by user avatar trichoplax‭ · 2024-06-15T13:47:17Z (6 months ago)
Add finalized tag for people who filter these out
#4: Post edited by user avatar Sylvester‭ · 2024-06-15T11:02:25Z (6 months ago)
Marked as finalized.
  • Fibonascii Squares
  • Fibonascii Squares [FINALIZED]
  • ## The Challenge
  • Your job is to, given input positive non-zero integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence.
  • ## Rules
  • Input:
  • - Input will be an integer $n$ such that $n \gt 0$.
  • Output:
  • - Output will be an ASCII representation of the tiled Fibonacci squares, up until the $n$th Fibonacci number.
  • - For Fibonacci number $x$, its respective square will be $x$ characters tall and $x$ characters wide.
  • - Squares must be tiled so as to match the arrangement shown in the examples below. However, the output may be mirrored or rotated by multiples of $90^\circ$ as desired.
  • - This challenge does include $0$ as a member of the Fibonacci sequence, so bear that in mind.
  • - For cases where $n$ is $1$ (and hence there aren't any squares to create), you may either output any number of whitespace characters or output nothing at all.
  • - Each square in the output must be represented by a grid made up of a unique ASCII character. For the characters forming your squares, you may use either the alphabet (either uppercase or lowercase, starting at `a`) or the digits 0-9 (starting at `0`). You may reuse characters once you reach the end of the character sequence. You must use at least five unique characters.
  • - This is a code-golf challenge, so the code with the fewest bytes wins!
  • ## Examples
  • Here is an image of the proper way to tile Fibonacci squares:
  • ![Fibonacci square arrangement.](https://codegolf.codidact.com/uploads/y7w0yy9iztcgb6eep8jy08llkpky)
  • <sup>Image source: [Wikipedia](https://en.wikipedia.org/wiki/File:Fibonacci_Squares.svg)</sup>
  • ### Example 1
  • ```
  • Input:
  • 5
  • Output:
  • DDDCC
  • DDDCC
  • DDDAB
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • ```
  • Explanation: The input is $5$, representing the first $5$ numbers of the Fibonacci sequence, which are $0$, $1$, $1$, $2$, $3$, and $5$. The first and second squares are $1 \times 1$ characters in size, and are represented by `A` and `B`, respectively. The third square is $2 \times 2$ characters in size, and is represented by `C`, and so on until we reach the fifth square.
  • ### Example 2
  • ```
  • Input:
  • 1
  • Output:
  • ```
  • Explanation: The input is $1$, representing the first number of the Fibonacci sequence, which is $0$. Thus, nothing is outputted. Alternatively, any number of whitespace characters could be outputted.
  • ### Example 3
  • ```
  • Input:
  • 3
  • Output:
  • AB
  • ```
  • Explanation:
  • The input is $3$, representing the first $3$ numbers of the Fibonacci sequence, which are $0$, $1$, and $1$. Thus, we have two squares, each $1 \times 1$ characters in size. The first square is represented by `A`, the second by `B`.
  • # Finalized: [Fibonascii Squares](https://codegolf.codidact.com/posts/291759)
  • -------------------------------
  • ## The Challenge
  • Your job is to, given input positive non-zero integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence.
  • ## Rules
  • Input:
  • - Input will be an integer $n$ such that $n \gt 0$.
  • Output:
  • - Output will be an ASCII representation of the tiled Fibonacci squares, up until the $n$th Fibonacci number.
  • - For Fibonacci number $x$, its respective square will be $x$ characters tall and $x$ characters wide.
  • - Squares must be tiled so as to match the arrangement shown in the examples below. However, the output may be mirrored or rotated by multiples of $90^\circ$ as desired.
  • - This challenge does include $0$ as a member of the Fibonacci sequence, so bear that in mind.
  • - For cases where $n$ is $1$ (and hence there aren't any squares to create), you may either output any number of whitespace characters or output nothing at all.
  • - Each square in the output must be represented by a grid made up of a unique ASCII character. For the characters forming your squares, you may use either the alphabet (either uppercase or lowercase, starting at `a`) or the digits 0-9 (starting at `0`). You may reuse characters once you reach the end of the character sequence. You must use at least five unique characters.
  • - This is a code-golf challenge, so the code with the fewest bytes wins!
  • ## Examples
  • Here is an image of the proper way to tile Fibonacci squares:
  • ![Fibonacci square arrangement.](https://codegolf.codidact.com/uploads/y7w0yy9iztcgb6eep8jy08llkpky)
  • <sup>Image source: [Wikipedia](https://en.wikipedia.org/wiki/File:Fibonacci_Squares.svg)</sup>
  • ### Example 1
  • ```
  • Input:
  • 5
  • Output:
  • DDDCC
  • DDDCC
  • DDDAB
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • ```
  • Explanation: The input is $5$, representing the first $5$ numbers of the Fibonacci sequence, which are $0$, $1$, $1$, $2$, $3$, and $5$. The first and second squares are $1 \times 1$ characters in size, and are represented by `A` and `B`, respectively. The third square is $2 \times 2$ characters in size, and is represented by `C`, and so on until we reach the fifth square.
  • ### Example 2
  • ```
  • Input:
  • 1
  • Output:
  • ```
  • Explanation: The input is $1$, representing the first number of the Fibonacci sequence, which is $0$. Thus, nothing is outputted. Alternatively, any number of whitespace characters could be outputted.
  • ### Example 3
  • ```
  • Input:
  • 3
  • Output:
  • AB
  • ```
  • Explanation:
  • The input is $3$, representing the first $3$ numbers of the Fibonacci sequence, which are $0$, $1$, and $1$. Thus, we have two squares, each $1 \times 1$ characters in size. The first square is represented by `A`, the second by `B`.
#3: Post edited by user avatar Sylvester‭ · 2024-06-13T14:50:32Z (6 months ago)
  • ## The Challenge
  • Your job is to, given input positive non-zero integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence.
  • ## Rules
  • Input:
  • - Input will be an integer $n$ such that $n \gt 0$.
  • Output:
  • - Output will be an ASCII representation of the tiled Fibonacci squares, up until the $n$th Fibonacci number.
  • - For Fibonacci number $x$, its respective square will be $x$ characters tall and $x$ characters wide.
  • - Squares must be tiled so as to match the arrangement shown in the examples below. However, the output may be mirrored or rotated as desired.
  • - This challenge does include $0$ as a member of the Fibonacci sequence, so bear that in mind.
  • - For cases where $n$ is $1$ (and hence there aren't any squares to create), you may either output any number of whitespace characters or output nothing at all.
  • - Each square in the output must be represented by a grid made up of a unique ASCII character. For the characters forming your squares, you may use either the alphabet (either uppercase or lowercase, starting at `a`) or the digits 0-9 (starting at `0`). You may reuse characters once you reach the end of the character sequence. You must use at least five unique characters.
  • - This is a code-golf challenge, so the code with the fewest bytes wins!
  • ## Examples
  • Here is an image of the proper way to tile Fibonacci squares:
  • ![Fibonacci square arrangement.](https://codegolf.codidact.com/uploads/y7w0yy9iztcgb6eep8jy08llkpky)
  • <sup>Image source: [Wikipedia](https://en.wikipedia.org/wiki/File:Fibonacci_Squares.svg)</sup>
  • ### Example 1
  • ```
  • Input:
  • 5
  • Output:
  • DDDCC
  • DDDCC
  • DDDAB
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • ```
  • Explanation: The input is $5$, representing the first $5$ numbers of the Fibonacci sequence, which are $0$, $1$, $1$, $2$, $3$, and $5$. The first and second squares are $1 \times 1$ characters in size, and are represented by `A` and `B`, respectively. The third square is $2 \times 2$ characters in size, and is represented by `C`, and so on until we reach the fifth square.
  • ### Example 2
  • ```
  • Input:
  • 1
  • Output:
  • ```
  • Explanation: The input is $1$, representing the first number of the Fibonacci sequence, which is $0$. Thus, nothing is outputted. Alternatively, any number of whitespace characters could be outputted.
  • ### Example 3
  • ```
  • Input:
  • 3
  • Output:
  • AB
  • ```
  • Explanation:
  • The input is $3$, representing the first $3$ numbers of the Fibonacci sequence, which are $0$, $1$, and $1$. Thus, we have two squares, each $1 \times 1$ characters in size. The first square is represented by `A`, the second by `B`.
  • ## The Challenge
  • Your job is to, given input positive non-zero integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence.
  • ## Rules
  • Input:
  • - Input will be an integer $n$ such that $n \gt 0$.
  • Output:
  • - Output will be an ASCII representation of the tiled Fibonacci squares, up until the $n$th Fibonacci number.
  • - For Fibonacci number $x$, its respective square will be $x$ characters tall and $x$ characters wide.
  • - Squares must be tiled so as to match the arrangement shown in the examples below. However, the output may be mirrored or rotated by multiples of $90^\circ$ as desired.
  • - This challenge does include $0$ as a member of the Fibonacci sequence, so bear that in mind.
  • - For cases where $n$ is $1$ (and hence there aren't any squares to create), you may either output any number of whitespace characters or output nothing at all.
  • - Each square in the output must be represented by a grid made up of a unique ASCII character. For the characters forming your squares, you may use either the alphabet (either uppercase or lowercase, starting at `a`) or the digits 0-9 (starting at `0`). You may reuse characters once you reach the end of the character sequence. You must use at least five unique characters.
  • - This is a code-golf challenge, so the code with the fewest bytes wins!
  • ## Examples
  • Here is an image of the proper way to tile Fibonacci squares:
  • ![Fibonacci square arrangement.](https://codegolf.codidact.com/uploads/y7w0yy9iztcgb6eep8jy08llkpky)
  • <sup>Image source: [Wikipedia](https://en.wikipedia.org/wiki/File:Fibonacci_Squares.svg)</sup>
  • ### Example 1
  • ```
  • Input:
  • 5
  • Output:
  • DDDCC
  • DDDCC
  • DDDAB
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • ```
  • Explanation: The input is $5$, representing the first $5$ numbers of the Fibonacci sequence, which are $0$, $1$, $1$, $2$, $3$, and $5$. The first and second squares are $1 \times 1$ characters in size, and are represented by `A` and `B`, respectively. The third square is $2 \times 2$ characters in size, and is represented by `C`, and so on until we reach the fifth square.
  • ### Example 2
  • ```
  • Input:
  • 1
  • Output:
  • ```
  • Explanation: The input is $1$, representing the first number of the Fibonacci sequence, which is $0$. Thus, nothing is outputted. Alternatively, any number of whitespace characters could be outputted.
  • ### Example 3
  • ```
  • Input:
  • 3
  • Output:
  • AB
  • ```
  • Explanation:
  • The input is $3$, representing the first $3$ numbers of the Fibonacci sequence, which are $0$, $1$, and $1$. Thus, we have two squares, each $1 \times 1$ characters in size. The first square is represented by `A`, the second by `B`.
#2: Post edited by user avatar Sylvester‭ · 2024-06-13T14:46:53Z (6 months ago)
Updated rules based on comments.
  • ## The Challenge
  • Your job is to, given input non-negative integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence.
  • ## Rules
  • Input:
  • - Input will be an integer $n$ such that $n \ge 0$.
  • Output:
  • - Output will be an ASCII representation of the tiled Fibonacci squares, up until the $n$th Fibonacci number.
  • - For Fibonacci number $x$, its respective square will be $x$ characters tall and $x$ characters wide.
  • - Squares must be tiled so as to match the arrangement shown in the examples below.
  • - This challenge does include $0$ as a member of the Fibonacci sequence, so bear that in mind.
  • - Each square in the output must be represented by a grid made up of a unique ASCII character. For the characters forming your squares, you may use either the alphabet (either uppercase or lowercase, starting at `a`) or the digits 0-9 (starting at `0`). You may reuse characters once you reach the end of the character sequence.
  • - This is a code-golf challenge, so the code with the fewest bytes wins!
  • ## Examples
  • Here is an image of the proper way to tile Fibonacci squares:
  • ![Fibonacci square arrangement.](https://codegolf.codidact.com/uploads/y7w0yy9iztcgb6eep8jy08llkpky)
  • <sup>Image source: [Wikipedia](https://en.wikipedia.org/wiki/File:Fibonacci_Squares.svg)</sup>
  • ### Example 1
  • ```
  • Input:
  • 5
  • Output:
  • DDDCC
  • DDDCC
  • DDDAB
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • ```
  • Explanation: The input is $5$, representing the first $5$ numbers of the Fibonacci sequence, which are $0$, $1$, $1$, $2$, $3$, and $5$. The first and second squares are $1 \times 1$ characters in size, and are represented by `A` and `B`, respectively. The third square is $2 \times 2$ characters in size, and is represented by `C`, and so on until we reach the fifth square.
  • ### Example 2
  • ```
  • Input:
  • 3
  • Output:
  • AB
  • ```
  • Explanation:
  • The input is $3$, representing the first $3$ numbers of the Fibonacci sequence, which are $0$, $1$, and $1$. Thus, we have two squares, each $1 \times 1$ characters in size. The first square is represented by `A`, the second by `B`.
  • ## The Challenge
  • Your job is to, given input positive non-zero integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence.
  • ## Rules
  • Input:
  • - Input will be an integer $n$ such that $n \gt 0$.
  • Output:
  • - Output will be an ASCII representation of the tiled Fibonacci squares, up until the $n$th Fibonacci number.
  • - For Fibonacci number $x$, its respective square will be $x$ characters tall and $x$ characters wide.
  • - Squares must be tiled so as to match the arrangement shown in the examples below. However, the output may be mirrored or rotated as desired.
  • - This challenge does include $0$ as a member of the Fibonacci sequence, so bear that in mind.
  • - For cases where $n$ is $1$ (and hence there aren't any squares to create), you may either output any number of whitespace characters or output nothing at all.
  • - Each square in the output must be represented by a grid made up of a unique ASCII character. For the characters forming your squares, you may use either the alphabet (either uppercase or lowercase, starting at `a`) or the digits 0-9 (starting at `0`). You may reuse characters once you reach the end of the character sequence. You must use at least five unique characters.
  • - This is a code-golf challenge, so the code with the fewest bytes wins!
  • ## Examples
  • Here is an image of the proper way to tile Fibonacci squares:
  • ![Fibonacci square arrangement.](https://codegolf.codidact.com/uploads/y7w0yy9iztcgb6eep8jy08llkpky)
  • <sup>Image source: [Wikipedia](https://en.wikipedia.org/wiki/File:Fibonacci_Squares.svg)</sup>
  • ### Example 1
  • ```
  • Input:
  • 5
  • Output:
  • DDDCC
  • DDDCC
  • DDDAB
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • EEEEE
  • ```
  • Explanation: The input is $5$, representing the first $5$ numbers of the Fibonacci sequence, which are $0$, $1$, $1$, $2$, $3$, and $5$. The first and second squares are $1 \times 1$ characters in size, and are represented by `A` and `B`, respectively. The third square is $2 \times 2$ characters in size, and is represented by `C`, and so on until we reach the fifth square.
  • ### Example 2
  • ```
  • Input:
  • 1
  • Output:
  • ```
  • Explanation: The input is $1$, representing the first number of the Fibonacci sequence, which is $0$. Thus, nothing is outputted. Alternatively, any number of whitespace characters could be outputted.
  • ### Example 3
  • ```
  • Input:
  • 3
  • Output:
  • AB
  • ```
  • Explanation:
  • The input is $3$, representing the first $3$ numbers of the Fibonacci sequence, which are $0$, $1$, and $1$. Thus, we have two squares, each $1 \times 1$ characters in size. The first square is represented by `A`, the second by `B`.
#1: Initial revision by user avatar Sylvester‭ · 2024-06-13T13:06:51Z (6 months ago)
Fibonascii Squares
## The Challenge

Your job is to, given input non-negative integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence.

## Rules

Input:

- Input will be an integer $n$ such that $n \ge 0$.

Output:

- Output will be an ASCII representation of the tiled Fibonacci squares, up until the $n$th Fibonacci number.

- For Fibonacci number $x$, its respective square will be $x$ characters tall and $x$ characters wide.

- Squares must be tiled so as to match the arrangement shown in the examples below.

- This challenge does include $0$ as a member of the Fibonacci sequence, so bear that in mind.

- Each square in the output must be represented by a grid made up of a unique ASCII character. For the characters forming your squares, you may use either the alphabet (either uppercase or lowercase, starting at `a`) or the digits 0-9 (starting at `0`). You may reuse characters once you reach the end of the character sequence.

- This is a code-golf challenge, so the code with the fewest bytes wins!

## Examples

Here is an image of the proper way to tile Fibonacci squares:

![Fibonacci square arrangement.](https://codegolf.codidact.com/uploads/y7w0yy9iztcgb6eep8jy08llkpky)

<sup>Image source: [Wikipedia](https://en.wikipedia.org/wiki/File:Fibonacci_Squares.svg)</sup>

### Example 1

```
Input:
5
Output:
DDDCC
DDDCC
DDDAB
EEEEE
EEEEE
EEEEE
EEEEE
EEEEE
```

Explanation: The input is $5$, representing the first $5$ numbers of the Fibonacci sequence, which are $0$, $1$, $1$, $2$, $3$, and $5$. The first and second squares are $1 \times 1$ characters in size, and are represented by `A` and `B`, respectively. The third square is $2 \times 2$ characters in size, and is represented by `C`, and so on until we reach the fifth square.

### Example 2

```
Input:
3
Output:
AB
```

Explanation:
The input is $3$, representing the first $3$ numbers of the Fibonacci sequence, which are $0$, $1$, and $1$. Thus, we have two squares, each $1 \times 1$ characters in size. The first square is represented by `A`, the second by `B`.