C463/B551 Artificial Intelligence

Homework 1 Lisp Version

Due date: Thursday, January 17, 2008.

Ex. 1 Write a function that stores a few 1-word strings in a list and prints them in random order. The function should capitalize the first of the printed strings to make the whole output look like a sentence.

Ex. 2 Write a Lisp function called power taking two arguments, one which is any number (could be 0) and a second one that you can assume is an integer (could be 0 or negative). The function should evaluate to the first number raised to the power of the second number. Note that 0 to a positive power is 0, 0^0 is 1, and 0 to a negative power should print an error message. Evaluate this expression to cover the possible cases.

Turn in: both of the functions and some examples of evaluating them in a single file.