#################################################
# collab6.py
#
# Your name:
# Your andrew id:
#################################################

import cs112_m20_unit6_linter
import math
import copy

#################################################
# Helper functions
#################################################

def almostEqual(d1, d2, epsilon=10**-7):
    # note: use math.isclose() outside 15-112 with Python version 3.5 or later
    return (abs(d2 - d1) < epsilon)

import decimal
def roundHalfUp(d):
    # Round to nearest with ties going away from zero.
    rounding = decimal.ROUND_HALF_UP
    # See other rounding options here:
    # https://docs.python.org/3/library/decimal.html#rounding-modes
    return int(decimal.Decimal(d).to_integral_value(rounding=rounding))

######################################################################
# ignore_rest: The autograder will ignore all code below here
######################################################################

import basic_graphics

def drawStar(canvas, centerX, centerY, diameter, numPoints, color):
    canvas.create_text(centerX, centerY,
        text="Implement drawStar!", font="Arial 20 bold")

def drawFlagOfPuertoRico(canvas, width, height):
    canvas.create_text(width//2, height//2,
        text="Implement drawFlagOfPuertoRico!", font="Arial 20 bold")

#################################################################
# Test Functions
# Note: You must look at the output of these and confirm
# they work visually.
# You are not required to write tests for any helper functions
# you write for graphics problems
#################################################################

def drawStarWrapper(canvas, width, height, centerX, centerY, diameter,
                    numPoints, color):
    drawStar(canvas, centerX, centerY, diameter, numPoints, color)

def testDrawStar():
    print("Testing drawStar()...")
    print("Since this is graphics, this test is not interactive.")
    print("Inspect each of these results manually to verify them.")
    basic_graphics.run(
        250, 250, 500, 5, "gold", drawFn=drawStarWrapper, width=500, height=500
    )
    basic_graphics.run(
        300, 400, 100, 4, "blue", drawFn=drawStarWrapper, width=500, height=500
    )
    basic_graphics.run(
        300, 200, 300, 9, "red", drawFn=drawStarWrapper, width=500, height=500
    )
    print("Done!")

def testDrawFlagOfPuertoRico():
    print("Testing drawFlagOfPuertoRico()...")
    print("Since this is graphics, this test is not interactive.")
    print("Inspect each of these results manually to verify them.")
    basic_graphics.run(drawFn=drawFlagOfPuertoRico,width=150,height=100)
    basic_graphics.run(drawFn=drawFlagOfPuertoRico,width=300,height=200)
    basic_graphics.run(drawFn=drawFlagOfPuertoRico,width=600,height=400)
    print("Done!")

#################################################
# testAll and main
#################################################

def testAll():
    testDrawStar()
    testDrawFlagOfPuertoRico()

def main():
    cs112_m20_unit6_linter.lint()
    testAll()

if __name__ == "__main__":
    main()
