Commit e9bc30ad authored by Daniel W Bond's avatar Daniel W Bond
Browse files

fixed small algorithmic troubles

parent 53255726
...@@ -98,8 +98,10 @@ def nextCourses(remainingReqCourses, alreadyTaken): ...@@ -98,8 +98,10 @@ def nextCourses(remainingReqCourses, alreadyTaken):
nextCourses = [] nextCourses = []
for course in remainingReqCourses: for course in remainingReqCourses:
reqs = set() reqs = set()
course.prereq.append(reqs) for prereq in course.preq:
course.coreq.append(reqs) reqs.add(prereq)
for coreq in course.coreq:
for req in reqs: for req in reqs:
if req in previousCourses: if req in previousCourses:
nextCourses.append(course) nextCourses.append(course)
...@@ -117,8 +119,10 @@ def findDependancies(deletedCourse, semester): ...@@ -117,8 +119,10 @@ def findDependancies(deletedCourse, semester):
foundDependancies = [] foundDependancies = []
for suspectCourse in for suspectCourse in
reqs = set() reqs = set()
suspectCourse.prereq.append(reqs) for prereq in suspectCourse.preq:
suspectCourse.coreq.append(reqs) reqs.add(prereq)
for coreq in suspectCourse.coreq:
for req in reqs: for req in reqs:
if req is deletedCourse: if req is deletedCourse:
req.append(foundDependancies) req.append(foundDependancies)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment