8 . /cs/www/classes/cs372/spring15/a8/tests /cs/www/classes/cs372/spring15/a8/master # # problem splits splits.pl build a8/checkpl splits.pl test splits template echo "findall(S, splits(,S),Answers)." | ./a.out case [1,2,3] case [] case [1,2] case [a,b,c,d] case ['//', ',', '[1]/[2]', '[1,2,3/4]'] case [a+b,a*c,1+2/3,[1,2,3]] # problem repl repl.pl build a8/checkpl repl.pl test repl template echo "" | ./a.out case once(repl(x,5,L)). case once(repl(1,3,[1,1,1])). case once(repl(1,3,[1,1,2])). case once((repl(X,2,L), X=7, repl(L,5,L5))). case once((repl(X,2,L), X=7, repl(L,5,L5), repl(L5, 1000,LMM), flatten(LMM,F), length(F,Len))). case once(repl(a,0,X)). case once(repl(a,-1,X)). # # problem pick pick.pl build a8/checkpl pick.pl test pick template echo "" | ./a.out case pick('testing', [0,6], S). case pick('testing', [1,1,1], S). case pick('testing', [10,2,4], S). case between(0,6,P), P2 is P+1, pick('testing', [P,P2], S), writeln(S), fail. case pick('testing', [], S). case pick('abcdefghijklmnopqrstuvwxyz0123456789', [13,29,22,5,44,43,12,46,17,40,37,2,39,2,2,2,2,7,15,42,18,41,35,4,3,4,3,4,3,4,33,36,34,31,48,9,19,1,47,27,50,10,28,8,26,25,38,23,49,45,6,30,3,32,4,14,20,24,16,21,11],S). # # problem polyperim polyperim.pl build a8/checkpl polyperim.pl test polyperim template echo 'findall(Perim,polyperim(,Perim),Perims).' | ./a.out case [pt(0,0),pt(3,4),pt(0,4),pt(0,0)] case [pt(3,4),pt(0,4),pt(0,0),pt(3,4)] case [pt(0,0),pt(0,1),pt(1,1),pt(1,0),pt(0,0)] case [pt(0,0),pt(1,1),pt(0,1),pt(1,0),pt(0,0)] case [pt(0,0),pt(3,4),pt(0,4)] case [pt(0,0),pt(0,4)] case [pt(0,0)] # # problem switched switched.pl build a8/checkpl switched.pl test switched template echo 'switched().' | ./a.out 2>&1 | sed '/^$/d' | sed 's/ *$//' case 51,58 case 54,59 case 56,57 case 53,57 case 54,55 # # problem iz iz.pl build a8/checkpl iz.pl test iz template echo "" | ./a.out case E = abc+def, R iz E. case E = abc*6, R iz E. case E = abc*(2+3-1), R iz E. case E = '123456789'/2, R iz E. case E = '123456789'/(-3), R iz E. case E = len(abc+def), R iz E. case E = len(abc)+len(def), R iz E. case E = len(len(len)), R iz E. case E = wrap(abc,len('*'*2),len('<'*3)), R iz E. case E = wrap(abc,x), R iz E. case E = wrap(dot,x), R iz E. case E = wrap(dot * 3, '='), R iz E. case E = wrap(dot * 3, '>','<'), R iz E. case X = 'ab', Y = 'cde', Z = 'zz', E = wrap(-(X+Y*4)/6+xyz, 'Start>','<'+(end*3+Z*2)), R iz E. case X = 'ab', Y = 'cde', Z = 'zz', E = len(wrap(-(X+Y*4)/6+xyz, 'Start>','<'+(end*3+Z*2))), R iz E. case E = wrap(zero/0,x), R iz E. case E = abc+xyz, R iz E. case E = (ab + cd)*2, R iz E. case E = -cat*3, R iz E. case E = abcde / 2, R iz E. case E = abcde / -3, R iz E. case E = wrap(aaa,'X'), R iz E. case E = wrap(abc,'*'*2,'<'*3), R iz E. case E = -(wrap(abc,'*.'*2,'<'*3)/2), R iz E. case E = -(wrap(abc,'*.'*2,len('<'*3))), R iz E. case N = 5, M = 3, X = 'ab', Y = 'cde', Z = 'zz', E1 = wrap(-(X+Y*4)/6+xyz,'Start>','<'+(end*3+Z*2)), E = wrap(wrap(-E1, E1*(N+1),-E1*(M+1)),'...'*3), R iz E. case X iz wrap(-(ab+cde*4)/6+xyz,'Start>','<'+(end*3+zz*2)). case X iz a+b+(c+(de+fg)+hij+k)+l. case X iz pi + e*3. case X = 2, Y= 3, S iz 'ab' * (X+Y*3). case S = '0123456789', R iz S + -S, End iz R / -(2+3). case X iz abc+(-abc).