Your task is to fill the bucket with numbers upto a given input.
Rules
Numbers occupy the leftmost position then rightmost, then leftmost and so on.
After overflow, the numbers start to gather around the bucket in a similar manner. They occupy position diagonally.
The examples should make it clear what the expected output is (Some rules are mentioned in the examples).
For more then 10, use the rightmost digit
Examples:
The bucket:
| | or | |
| | | |
| | | |
| | | |
|------| |______|
input:1 (You can start from either 0 or 1)
output:
| | (There can be whitespace to the left even if there is no overflow
| | but the bucket must not be distorted.)
| |
|1 |
|------|
input:6
output:
| |
| |
| |
|135642|
|------|
input:8
output:
| |
| |
|7 8|
|135642|
|------|
input:23
output:
|913 20|
|357864|
|791208|
|135642|
|------|
input:27
output:
|913420|
|357864|
|791208|
|135642|
75|------|6
input:30
output:
|913420|
|357864|
|791208|
9|135642|0
75|------|68
input:40
output:
|913420|
|357864|
5|791208|6
939|135642|040
7175|------|6828
input:54 (Maximum input for start=1)
3|913420|4
13|357864|42
915|791208|620
7939|135642|0408
57175|------|68286
This is code-golf so shortest code wins.
|024531|
for \$n=6\$) or only the input? \$\endgroup\$ – Arnauld Dec 11 '18 at 18:37