Skip to main content
added "notice that"
Source Link
sporkl
  • 6.9k
  • 1
  • 27
  • 63

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

__

n=1:

__/\__

n=2:

      __/\__
      \    /
__/\__/    \__/\__

n=3:

                        __/\__
                        \    /
                  __/\__/    \__/\__
                  \                /
                  /_              _\
                    \            /
      __/\__      __/            \__      __/\__
      \    /      \                /      \    /
__/\__/    \__/\__/                \__/\__/    \__/\__

I hope this makes sense. Notice that in each test case, the fractal can be divided into three parts equal in length. Also notice that the width of each snowflake is three times the width of the previous generation of the snowflake.

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

__

n=1:

__/\__

n=2:

      __/\__
      \    /
__/\__/    \__/\__

n=3:

                        __/\__
                        \    /
                  __/\__/    \__/\__
                  \                /
                  /_              _\
                    \            /
      __/\__      __/            \__      __/\__
      \    /      \                /      \    /
__/\__/    \__/\__/                \__/\__/    \__/\__

I hope this makes sense. Notice that in each test case, the fractal can be divided into three parts equal in length.

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

__

n=1:

__/\__

n=2:

      __/\__
      \    /
__/\__/    \__/\__

n=3:

                        __/\__
                        \    /
                  __/\__/    \__/\__
                  \                /
                  /_              _\
                    \            /
      __/\__      __/            \__      __/\__
      \    /      \                /      \    /
__/\__/    \__/\__/                \__/\__/    \__/\__

I hope this makes sense. Notice that in each test case, the fractal can be divided into three parts equal in length. Also notice that the width of each snowflake is three times the width of the previous generation of the snowflake.

modified test case----
Source Link
sporkl
  • 6.9k
  • 1
  • 27
  • 63

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

__

n=1:

__/\__

n=2:

      __/\__
      \    /
__/\__/    \__/\__

n=3:

                        __/\__
                        \    /
                  __/\__/    \__/\__
                  \                /
                  /___            __\  _\
                    \            /
      __/\__      __/            \__      __/\__
      \    /      \                /      \    /
__/\__/    \__/\__/                \__/\__/    \__/\__

I hope this makes sense. Notice that in each test case, the fractal can be divided into three parts equal in length.

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

__

n=1:

__/\__

n=2:

      __/\__
      \    /
__/\__/    \__/\__

n=3:

                       __/\__
                       \    /
                 __/\__/    \__/\__
                 \                /
                 /__            __\
                    \          /
      __/\__      __/          \__      __/\__
      \    /      \              /      \    /
__/\__/    \__/\__/              \__/\__/    \__/\__

I hope this makes sense.

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

__

n=1:

__/\__

n=2:

      __/\__
      \    /
__/\__/    \__/\__

n=3:

                        __/\__
                        \    /
                  __/\__/    \__/\__
                  \                /
                  /_              _\
                    \            /
      __/\__      __/            \__      __/\__
      \    /      \                /      \    /
__/\__/    \__/\__/                \__/\__/    \__/\__

I hope this makes sense. Notice that in each test case, the fractal can be divided into three parts equal in length.

modified test cases
Source Link
sporkl
  • 6.9k
  • 1
  • 27
  • 63

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

___

n=1:

___/\_\__

n=2:

    _  __/\_\__
      \    /
___/\_\__/  \_  \__/\_\__

n=3:

               _        __/\_\__
                       \    /
           _      __/\_\__/  \_  \__/\_\__
                 \                /
                 /___        _\    __\
                    \          /
    _  __/\_\__    _  __/      \_    _\__      __/\_\__
      \    /      \              /      \    /
___/\_\__/  \_  \__/\_\__/        \_      \__/\_\__/  \_  \__/\_\__

I hope this makes sense.

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

_

n=1:

_/\_

n=2:

    _/\_
    \  /
_/\_/  \_/\_

n=3:

               _/\_
               \  /
           _/\_/  \_/\_
           \          /
           /_        _\
             \      /
    _/\_    _/      \_    _/\_
    \  /    \        /    \  /
_/\_/  \_/\_/        \_/\_/  \_/\_

I hope this makes sense.

Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.

Rules:

  • The program must generate one side of the Koch snowflake to the nth depth.
  • Output must be ASCII.
  • You may generate the whole snowflake; this is not required.
  • Standard rules for input/output and loopholes and stuff apply.
  • Whitespace does not matter, as long as it all characters are in the right place relative to each other.
  • Shortest code wins!

Test cases:

n=0:

__

n=1:

__/\__

n=2:

      __/\__
      \    /
__/\__/    \__/\__

n=3:

                       __/\__
                       \    /
                 __/\__/    \__/\__
                 \                /
                 /__            __\
                    \          /
      __/\__      __/          \__      __/\__
      \    /      \              /      \    /
__/\__/    \__/\__/              \__/\__/    \__/\__

I hope this makes sense.

Tweeted twitter.com/StackCodeGolf/status/847292010742534146
changed tags
Source Link
sporkl
  • 6.9k
  • 1
  • 27
  • 63
Loading
edited tags
Source Link
Riker
  • 7.9k
  • 4
  • 39
  • 73
Loading
edited tags
Link
Riker
  • 7.9k
  • 4
  • 39
  • 73
Loading
Source Link
sporkl
  • 6.9k
  • 1
  • 27
  • 63
Loading