print("Spin number: ")
spin = int(input())
print("How many blocks?")
n = int(input())
print("Both sides? y/n")
both_side = input()

f = open('sweeper_move_code.mcfunction', 'w')
f.write(f'execute as @e[type=armor_stand,tag=spin{spin},tag=0] at @s run tp @s ~ ~ ~ ~<angle> ~\n\n')

for i in range(1, n + 1):
    f.write(f'execute as @e[type=armor_stand,tag=spin{spin},tag=0] at @s run tp @e[type=armor_stand,tag=spin{spin},tag={i}] ^ ^ ^{i} facing entity @s\n')

if (both_side == "y"):
    f.write("\n")
    for i in range(1, n + 1):
        f.write(f'execute as @e[type=armor_stand,tag=spin{spin},tag=0] at @s run tp @e[type=armor_stand,tag=spin{spin},tag=-{i}] ^ ^ ^-{i} facing entity @s\n')


f.close()