from math import *

sizes = range(10)

class MinecraftFunction:
    def __init__(self,filename):
        self.filename = filename
        self.file = open(f'{filename}.txt','w')

    def setBlock(self,x,y,z,block='stone',relative=True):
        if relative:
            self.file.write(f'/setblock ~{x} ~{y} ~{z} {block}\n')
        else:
            self.file.write(f'/setblock {x} {y} {z} {block}\n')

    def addCommand(self,command):
        self.file.write(f'{command}\n')

    def close(self):
        self.file.close()

class MinecraftCircleFunction (MinecraftFunction):
    def __init__(self,filename,radius):
        super().__init__(filename)

        for x in range(-radius,radius+1):
            for y in range(-radius,radius+1):
                if ceil(hypot(x,y)) == radius:
                    self.addCommand(f'/clone ~ ~-1 ~ ~ ~-1 ~ ~{x} ~ ~{y}')
        self.addCommand('/tellraw @p ["",{"text":"Circle of radius '+str(radius)+' made","color":"gold","bold":true}]')


for r in range(2,100):
    c = MinecraftCircleFunction(str(r),r)
    c.close()
