/**
 * This exercise is aimed at helping graphic designers practice negative indexing and creating a tuple using parentheses.
 *
 * Given a list of dimensions for a rectangle (length, width), the function should return the coordinates of the four corners of the rectangle as a tuple.
 *
 * @param dims A list of two integers representing the dimensions of the rectangle (length, width).
 * @return A tuple containing the coordinates of the four corners of the rectangle in the following order: top-left, top-right, bottom-right, bottom-left.
 *
 * Example:
 * createRectangle(listOf(5, 3)) -> listOf(Pair(0, 0), Pair(4, 0), Pair(4, -2), Pair(0, -2))
 */
fun createRectangle(dims: List<Int>): List<Pair<Int, Int>> {

    val length = dims[0]
    val width = dims[1]

    val x1 = 0
    val y1 = 0

    val x2 = length - 1
    val y2 = 0

    val x3 = length - 1
    val y3 = -width + 1

    val x4 = 0
    val y4 = -width + 1

    return listOf(Pair(x1, y1), Pair(x2, y2), Pair(x3, y3), Pair(x4, y4))
}
/**
 * This exercise is aimed at helping graphic designers practice negative indexing and creating a tuple using parentheses.
 *
 * Given a list of dimensions for a rectangle (length, width), the function should return the coordinates of the four corners of the rectangle as a tuple.
 *
 * @param dims A list of two integers representing the dimensions of the rectangle (length, width).
 * @return A tuple containing the coordinates of the four corners of the rectangle in the following order: top-left, top-right, bottom-right, bottom-left.
 *
 * Example:
 * createRectangle(listOf(5, 3)) -> listOf(Pair(0, 0), Pair(4, 0), Pair(4, -2), Pair(0, -2))
 */
fun createRectangle(dims: List<Int>): List<Pair<Int, Int>> {
/**
 * This exercise is aimed at helping graphic designers practice negative indexing and creating a tuple using parentheses.
 *
 * Given a list of dimensions for a rectangle (length, width), the function should return the coordinates of the four corners of the rectangle as a tuple.
 *
 * @param dims A list of two integers representing the dimensions of the rectangle (length, width).
 * @return A tuple containing the coordinates of the four corners of the rectangle in the following order: top-left, top-right, bottom-right, bottom-left.
 *
 * Example:
 * createRectangle(listOf(5, 3)) -> listOf(Pair(0, 0), Pair(4, 0), Pair(4, -2), Pair(0, -2))
 */
fun createRectangle(dims: List<Int>): List<Pair<Int, Int>> {

    val length = dims[0]
    val width = dims[1]

    val x1 = 0
    val y1 = 0

    val x2 = length - 1
    val y2 = 0

    val x3 = length - 1
    val y3 = -width + 1

    val x4 = 0
    val y4 = -width + 1

    return listOf(Pair(x1, y1), Pair(x2, y2), Pair(x3, y3), Pair(x4, y4))
}