- Timestamp:
- Nov 3, 2024, 9:13:16 PM (2 weeks ago)
- Branches:
- master
- Children:
- 7d95bce9
- Parents:
- 63a7394
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa
r63a7394 rc3e41cda 30 30 forall( [C], [S] ) 31 31 int getPref( @School( C, S ) & school@, int is, int pref ) { 32 33 32 for ( ic; C ) { 33 int curPref = @school.preferences@[ic][is]; $\C{// offset calculation implicit}$ 34 34 if ( curPref == pref ) return ic; 35 35 } 36 36 assert( false ); 37 37 } 38 38 … … 59 59 60 60 { string sv; 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 61 int iv; 62 // headers' row 63 sin | "\nc\\s"; 64 for ( is ; ns ) { 65 // column label 66 sin | sv; 67 school.student_ids[is] = sv; 68 } 69 // body rows 70 for ( ic ; nc ) { 71 // row label 72 sin | sv; 73 school.course_codes[ic] = sv; 74 for ( is ; ns ) { 75 // matrix item 76 sin | iv; 77 school.preferences[ic][is] = iv; 78 } 79 } 80 } 81 81 82 82 … … 91 91 sout | school.student_ids[is] | ": " | nonl; 92 92 for ( pref; 1 ~= nc ) { 93 94 93 int ic = getPref(school, is, pref); 94 sout | school.course_codes[ ic ] | nonl; 95 95 } 96 96 sout | nl;
Note: See TracChangeset
for help on using the changeset viewer.