# Tool made by KikooDX. Under CC-BY license.
# kikoodata.000webhostapp.com

item = 0 #Item ID, set to 0 and increase
x = 248
y = 136
file_name = input("Enter the name of the file to save in :\n> ")
file = open(file_name, "w")
file.write("[save]\n")
file.close()
file = open(file_name, "a")

size = int(input("Diamond size :\n> "))
object_id = int(input("Draw the diamond with (wall is 75) :\n> "))
precision = int(input("Enter the precision (greater is nicer).\n" +\
    "May cause lag with big values.\n> "))

set_offset = input("Do you want to offset the diamond from the center ? (y/n)")
if len(set_offset) == 1 and set_offset in "Yy":
    x += int(input("X offset :\n>"))
    y += int(input("Y offset :\n>"))

y -= size

print("Start building")

for i in range(4):
    if i == 0:
        dir_x = 1
        dir_y = 1
    elif i == 1:
        dir_x = -1
        dir_y = 1
    elif i == 2:
        dir_x = -1
        dir_y = -1
    elif i == 3:
        dir_x = 1
        dir_y = -1
    dir_x /= precision
    dir_y /= precision
    
    for i in range(size * precision):
        for step in range(3):
            file.write(str(item) + str(step) + "=\"")
            if step == 0:
                file.write(str(object_id))
            elif step == 1:
                file.write(str(x))
                x += dir_x
            elif step == 2:
                file.write(str(y))
                y += dir_y
            file.write("\"\n")
        item += 1

file.close()
input("Build completed\n\nPress enter to terminate")