/**
 * Check if a set of dots intersect with a given line segment.
 *
 * @param dots List of (x, y) coordinates representing the dots.
 * @return List containing the dots that intersect with the line.
 */
fun intersectionCheck(dots: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val line = Pair(Pair(0, 0), Pair(10, 10)) // Line segment coordinates

    // Check if each dot intersects with the line segment
    val intersectingDots = mutableListOf<Pair<Int, Int>>()
    for (dot in dots) {
        val (x, y) = dot

        if (x > line.first.first && x < line.second.first && y > line.first.second && y < line.second.second) {
            // Dot is inside the line segment
            intersectingDots.add(dot)
        } else if (x < line.first.first || x > line.second.first || y < line.first.second || y > line.second.second) {
            // Dot is outside the line segment
            intersectingDots.add(dot)
        } else {
            // Dot is on the line segment boundary
            intersectingDots.add(dot)
        }
    }

    return intersectingDots
}
/**
 * Check if a set of dots intersect with a given line segment.
 *
 * @param dots List of (x, y) coordinates representing the dots.
 * @return List containing the dots that intersect with the line.
 */
fun intersectionCheck(dots: List<Pair<Int, Int>>): List<Pair<Int, Int>> {
/**
 * Check if a set of dots intersect with a given line segment.
 *
 * @param dots List of (x, y) coordinates representing the dots.
 * @return List containing the dots that intersect with the line.
 */
fun intersectionCheck(dots: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val line = Pair(Pair(0, 0), Pair(10, 10)) // Line segment coordinates

    // Check if each dot intersects with the line segment
    val intersectingDots = mutableListOf<Pair<Int, Int>>()
    for (dot in dots) {
        val (x, y) = dot

        if (x > line.first.first && x < line.second.first && y > line.first.second && y < line.second.second) {
            // Dot is inside the line segment
            intersectingDots.add(dot)
        } else if (x < line.first.first || x > line.second.first || y < line.first.second || y > line.second.second) {
            // Dot is outside the line segment
            intersectingDots.add(dot)
        } else {
            // Dot is on the line segment boundary
            intersectingDots.add(dot)
        }
    }

    return intersectingDots
}