function joinCourses(dropped_courses) {
    var prereq_list;
    var course_index;

//Check all the courses dropped in dropspace and verify the prerequisites for each one
    for (var i = 0; i < dropped_courses.length; i++) {
        prereq_list = getPrereq(dropped_courses[i]);
        for (var j = 0; j < prereq_list.length; j++) {
            //Check if the prerequisite has been dropped before
            course_index = arrayContains(dropped_courses, prereq_list[j]);
            if (course_index >= 0) {
                //Connect the courses using a line
                drawLine(dropped_courses[i], dropped_courses[course_index]);
            }
        }
    }
}
//Function to prepare the courses to be joined using lines.
Function to prepare the courses to be joined using lines.
Function to prepare the courses to be joined using lines .
function joinCourses(dropped_courses) {
    var prereq_list;
    var course_index;
    for (var i = 0; i < dropped_courses.length; i++) {
        prereq_list = getPrereq(dropped_courses[i]);
        for (var j = 0; j < prereq_list.length; j++) {
            course_index = arrayContains(dropped_courses, prereq_list[j]);
            if (course_index >= 0) {
                drawLine(dropped_courses[i], dropped_courses[course_index]);
            }
        }
    }
}
function joinCourses ( dropped_courses ) { var prereq_list ; var course_index ; for ( var i = 0 ; i < dropped_courses . length ; i ++ ) { prereq_list = getPrereq ( dropped_courses [ i ] ) ; for ( var j = 0 ; j < prereq_list . length ; j ++ ) { course_index = arrayContains ( dropped_courses , prereq_list [ j ] ) ; if ( course_index >= 0 ) { drawLine ( dropped_courses [ i ] , dropped_courses [ course_index ] ) ; } } } }
Function to prepare the courses to be joined using lines.
Function to prepare the courses to be joined using lines .
//Check all the courses dropped in dropspace and verify the prerequisites for each one //Check if the prerequisite has been dropped before //Connect the courses using a line