



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




For Grading
{Test {Find [a b c d] a} ’==’ 1} {Test {Find [a b c d] e} ’==’ ~1} {Test {Find [a b c d e f g] c} ’==’ 3} {Test {Find [[99] [86] [12 22] nil [3]] [3]} ’==’ 5} {Test {Find [nil [3]] [3]} ’==’ 2} {Test {Find nil 72} ’==’ ~1} {Test {Find [penn ohio flor iowa] vote} ’==’ ~1}
local FLTemps = {StateTemps 60 90} in {Test {FLTemps nil} ’==’ nil} {Test {FLTemps [60 90 32 72]} ’==’ [60 90 72]} {Test {FLTemps [59 91]} ’==’ nil} {Test {FLTemps [100 95 90 85 80 75 70 65 60 55 50 45 40]} ’==’ [90 85 80 75 70 65 60]} {Test {FLTemps [~2 10 5 91 77 3 77 5 89 89 77]} ’==’ [77 77 89 89 77]} end local IATemps = {StateTemps ~30 100} in {Test {IATemps [60 90 0 ~4 ~30 ~33 32 172]} ’==’ [60 90 0 ~4 ~30 32]} {Test {IATemps [~20 10 5 101 100 3 100 5 89 89 100]} ’==’ [~20 10 5 100 3 100 5 89 89 100]} end {Test {{StateTemps ~50 65} [~51 ~50 60 ~50]} ’==’ [~50 60 ~50]}
{Test {ApplyList [Not Not] true } ’==’ [ false false ]} {Test {ApplyList [ fun {$ X} bread#X#bread end fun {$ X} pita#X#pita end ] turkey} ’==’ [bread#turkey#bread pita#turkey#pita]} {Test {ApplyList nil 33} ’==’ nil} {Test {ApplyList [ fun {$ X} X+1 end ] 4020} ’==’ [4021]} {Test {ApplyList [ fun {$ X} X+1 end fun {$ X} X+2 end ] 4020} ’==’ [4021 4022]} {Test {ApplyList local AddC = fun {$ Y} fun {$ X} X+Y end end in {Map [1 2 3 4 5 2 27 999] AddC} end 1000} ’==’ [1001 1002 1003 1004 1005 1002 1027 1999]}
%% Assume this function in your solution %% NecessarilyTrue : <fun {$