Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSDictionary *course_dict = @{
- @"CS 1" : @[],
- @"CS 31" : @[],
- @"CS 32" : @[@"CS 31"],
- @"CS 33" : @[@"CS 32"],
- @"CS 35L" : @[@"CS 31"],
- @"CS M51A" : @[],
- @"CS 111" : @[@"CS 32", @"CS 33", @"CS 35L"],
- @"CS M117" : @[],
- @"CS M151B" : @[@"CS 33", @"CS M51A"],
- @"CS 130" : @[@"CS 111"],
- @"CS 131" : @[@"CS 33", @"CS 35L"],
- @"CS 118" : @[@"CS 111"],
- @"CS 152A" : @[@"CS M51A"],
- @"CS 152B" : @[@"CS 151B"],
- @"CS 180" : @[@"CS 31", @"Math 61"],
- @"CS 181" : @[@"180"],
- @"Math 31A" : @[],
- @"Math 31B" : @[@"Math 31A"],
- @"Math 32A" : @[@"Math 31A"],
- @"Math 32B" : @[@"Math 31B", @"Math 32A"],
- @"Math 33A" : @[@"Math 32A"],
- @"Math 33B" : @[@"Math 31B"],
- @"Math 61" : @[@"Math 31A", @"Math 31B"],
- @"Phy 1A" : @[@"Math 31A", @"Math 31B"],
- @"Phy 1B" : @[@"Phy 1A", @"Math 32A", @"Math 31B"],
- @"Phy 1C" : @[@"Phy 1A", @"Phy 1B", @"Math 32A", @"Math 32B"],
- @"Phy 4AL" : @[@"Phy 1A"],
- @"Phy 4BL" : @[@"Phy 1A", @"Phy 1B"],
- };
- // create registrar
- NSMutableArray *courses;
- // for each course
- for (id key in course_dict) {
- Course *course = [[Course alloc] init];
- course.name = key;
- // for each prereq
- for (id prereq in [course_dict objectForKey:key]) {
- // add it to the list of prereqs
- Course *p = [[Course alloc] init];
- p.name = prereq;
- [course.prereqs addObject:p];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement