Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix prereq #7

Closed
ninest opened this issue Aug 2, 2022 · 2 comments
Closed

Fix prereq #7

ninest opened this issue Aug 2, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@ninest
Copy link
Owner

ninest commented Aug 2, 2022

A list of or groups and and groups isn't enough for preqs. For example, CS 3000:

Actual:

(CS 2510 or DS 2500) and CS 1800 or EECE 2160

Output:

CS 2510 or (DS 2500 and CS 1800) or EECE 2160

[
  [ { subject: "CS", number: "2510" } ],
  [ { subject: "DS", number: "2500" }, { subject: "CS", number: "1800" } ],
  [ { subject: "EECE", number: "2160" } ]
]
@ninest ninest added the bug Something isn't working label Aug 2, 2022
@ninest
Copy link
Owner Author

ninest commented Aug 2, 2022

Some courses have prereqs (ex, Graduate Admission) which aren't courses

@ninest
Copy link
Owner Author

ninest commented Aug 2, 2022

Switching to a structure that looks like

[
  "(",
  "(",
  { subject: "CS", number: "2510" },
  "Or",
  { subject: "DS", number: "2500" },
  ")",
  "And",
  { subject: "CS", number: "1800" },
  ")",
  "Or",
  { subject: "EECE", number: "2160" }
]

which translates to

( ( CS 2510 or DS 2500 ) and CS 1800 ) or EECE 2160

which is more accurate.

Types:

type PrerequisiteItem = "Or" | "And" | "(" | ")" | Requisite | string;

string is included because some courses have prereqs which aren't courses

@ninest ninest closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant