Homework 1c What to hand in : Once all the following is working, run : : ~timm/bin/handin : : Then print and STAPLE hand in the file ~/tmp/2print.pdf. Q0 Setip : Checkout this week's support code into ~/x72/csx72gpXX/1/c : using svn export : http://unbox.org/wisp/var/timm/10/ai/etc/proj/1/c Q1 Write median.lisp : Implement a fuction that returns the median of a list of numbers : e.g. (median '(1 2 4 5)) ==> 3 : If the list is of even size, then the median is in between the : middle two numbers Hints nth returns the nth item in a list length returns the length of a list Usage :Modify main.lisp so it loads, them runs your code. : (format t "~%==== 1/c/1 ===================================~%~%" : : (load "median") : (load "cat") : (cat "median.lisp") : (print (median '(1 2 4 5))) : (print (median '(1 2 3 4 5))) : (print (median '(1 2))) Q2 Write : Starting with the file "normal.lisp", write "triangular.lisp" : that accepts a keeps a set of numbers as the triangular : distribution TR(a,b,c) where "a,c" are the min,max seen and : "b" is the median value. Remember to define "test-triangular" : in the same manner as "test-normal" (in the normal.lisp) file. Hints : http://en.wikipedia.org/wiki/Triangular_distribution : Youl ony need the mean, stdev, pdf equations Usage : Add these lines to main.lisp : (format t "~%==== 1/c/2 ===================================~%~%" : : (load "triangular") : (cat "triangular") : (test-triangular) Q3 Debug : The gaming code shown in class has a bug. If our hero staggers : around for a while, we runs into the water. This means he cannot : breathe and is drowning. Help him. Fix the bug such that he : never drowns , even after lots of drunken staggering. Write : Write a text file describing the bug. : Catch an output of a stagger, with no drowning. Usage : Add these lines to main.lisp : (format t "~%==== 1/c/3 ===================================~%~%" : : (cat "whatwasthebug.txt") : (cat "staggering.out")