
from __future__ import annotations

import matplotlib.pyplot as plt  # type: ignore
import numpy

# initial triangle of Koch snowflake
__lowerCAmelCase					   =       numpy.array([0, 0])
__lowerCAmelCase					   =       numpy.array([0.5, 0.866_0254])
__lowerCAmelCase					   =       numpy.array([1, 0])
__lowerCAmelCase					   =       [VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]


def    a      ( a		,						a	)     ->list[numpy.ndarray]:




			'''simple docstring'''


			SCREAMING_SNAKE_CASE     						= initial_vectors
			for _ in range(a	):
						SCREAMING_SNAKE_CASE     						= iteration_step(a	)
			return vectors


def    a      ( a	)     ->list[numpy.ndarray]:




			'''simple docstring'''


			SCREAMING_SNAKE_CASE     						= []
			for i, start_vector in enumerate(vectors[:-1]	):
						SCREAMING_SNAKE_CASE     						= vectors[i + 1]
						new_vectors.append(a	)
						SCREAMING_SNAKE_CASE     						= end_vector - start_vector
						new_vectors.append(start_vector + difference_vector / 3	)
						new_vectors.append(
						    start_vector + difference_vector / 3 + rotate(difference_vector / 3		,						60	)	)
						new_vectors.append(start_vector + difference_vector * 2 / 3	)
			new_vectors.append(vectors[-1]	)
			return new_vectors


def    a      ( a		,						a	)     ->numpy.ndarray:




			'''simple docstring'''


			SCREAMING_SNAKE_CASE     						= numpy.radians(a	)
			SCREAMING_SNAKE_CASE						,							SCREAMING_SNAKE_CASE     						= numpy.cos(a	), numpy.sin(a	)
			SCREAMING_SNAKE_CASE     						= numpy.array(((c, -s), (s, c))	)
			return numpy.dot(a		,						a	)


def    a      ( a	)     ->None:




			'''simple docstring'''


			SCREAMING_SNAKE_CASE     						= plt.gca()
			axes.set_aspect('''equal'''	)

			# matplotlib.pyplot.plot takes a list of all x-coordinates and a list of all
			# y-coordinates as inputs, which are constructed from the vector-list using
			# zip()
			SCREAMING_SNAKE_CASE						,							SCREAMING_SNAKE_CASE     						= zip(*a	)
			plt.plot(a		,						a	)
			plt.show()


if __name__ == "__main__":
							import doctest

							doctest.testmod()

							__lowerCAmelCase					   =       iterate(INITIAL_VECTORS, 5)
							plot(processed_vectors)

# Function to print upper half of diamond (pyramid)


def    a      ( a	)     ->Optional[Any]:




			'''simple docstring'''


			for i in range(0		,						a	):
						for _ in range(0		,						n - i - 1	):  # printing spaces
									print(''' '''		,						end=''''''	)
						for _ in range(0		,						i + 1	):  # printing stars
									print('''* '''		,						end=''''''	)
						print()


def    a      ( a	)     ->Union[str, Any]:




			'''simple docstring'''


			for i in range(a		,						0		,						-1	):
						for _ in range(a		,						0		,						-1	):  # printing stars
									print('''* '''		,						end=''''''	)
						print()
						for _ in range(n - i + 1		,						0		,						-1	):  # printing spaces
									print(''' '''		,						end=''''''	)


def    a      ( a	)     ->Optional[int]:




			'''simple docstring'''


			if n <= 0:
						print('''       ...       ....        nothing printing :('''	)
						return
			floyd(a	)  # upper half
			reverse_floyd(a	)  # lower half


if __name__ == "__main__":
							print(R'| /\ | |- |  |-  |--| |\  /| |-')
							print(R'|/  \| |- |_ |_  |__| | \/ | |_')
							__lowerCAmelCase					   =       1
							while K:
														__lowerCAmelCase					   =       int(input('enter the number and , and see the magic : '))
														print()
														pretty_print(user_number)
														__lowerCAmelCase					   =       int(input('press 0 to exit... and 1 to continue...'))

							print('Good Bye...')