You are on page 1of 31

TIME’S

START UP!
TIMER Artificiale inttelegence
Lab report

30

25 5

20 10

15

design by ilias ahmed 1


TIME’S
START UP!
TIMER Submit by ilias ahmed
Id16339202142
39th batch

60

50 10

40 20

30

design by ilias ahmed 2


design by ilias ahmed 3
Lisp is the second-oldest high-level programming language after Fortran and has
changed a great deal since its early days, and a number of dialects have existed over
its history. Today, the most widely known general-purpose Lisp dialects are Common
Lisp and Scheme.

This Photo by Unknown Author is licensed under CC BY-SA

design by ilias ahmed 4


LAB REPORT
design by ilias ahmed 5
design by ilias ahmed 6
design by ilias ahmed 7
arithmetic operators supported by LISP. Assume variable A holds 10 and
variable B holds 20 then:

Operator Description Example

+ Adds two operands (+A B) will give 30

- Subtracts second operand from the (- A B) will give -10


first

* Multiplies both operands (* A B) will give 200

/ Divides numerator by de-numerator (/ B A) will give 2

design by ilias ahmed 8


Assume variable A holds 10 and variable B holds 20, then:

Operator Description Example


= Checks if the values of the (= A B) is not true.
operands are all equal or not, if
yes then condition becomes
true.
/= Checks if the values of the (/= A B) is true.
operands are all different or not,
if values are not equal then
condition becomes true.
> Checks if the values of the (> A B) is not true.
operands are monotonically
decreasing.
< Checks if the values of the (< A B) is true.
design by ilias ahmed 9
operands are monotonically
Assume A has value nil and Bhas value 5, then:

Operator Description Example

and It takes any number of (and A B) will return NIL.


arguments. The arguments are
evaluated left to right. If all
arguments evaluate to non-nil,
then the value of the last
argument is returned. Otherwise
nil is returned.
or It takes any number of (or A B) will return 5.
arguments. The arguments are
evaluated left to right until one
evaluates to non-nil, in such case
the argument value is returned,
otherwise it returns nil.
not It takes one argument and (not A) will return T.
returns t if the argument
evaluates to nil.
design by ilias ahmed 10
WRITE A AREA OF CIRCLE PROGRAMM IN LISP PROGRAMMING
(defconstant PI 3.141592)
(defun area-circle(rad)
(terpri) ;DESIGN BY ILIAS AHMED
(format t "Radius: ~5f" rad)
(format t "~%Area: ~10f" (* PI rad rad)))
(area-circle 10)
OUPUT:
Radius: 10.0Area: 314.1592

design by ilias ahmed 11


design by ilias ahmed 12
design by ilias ahmed 13
design by ilias ahmed 14
design by ilias ahmed 15
design by ilias ahmed 16
design by ilias ahmed 17
design by ilias ahmed 18
design by ilias ahmed 19
design by ilias ahmed 20
design by ilias ahmed 21
Design by ilias ahmed

design by ilias ahmed 22


design by ilias ahmed 23
Design by ilias ahmed

design by ilias ahmed 24


design by ilias ahmed 25
design by ilias ahmed 26
TIME’S
START UP!
TIMER TIME LIMIT:
2 minutes

120
110 10

100 20

90 30

80 40

70 50
60

design by ilias ahmed 27


design by ilias ahmed 28
TIME’S
START UP!
TIMER TIME LIMIT:
10 minutes

10
9 1

8 2

7 3

6 4
5

design by ilias ahmed 29


TIME’S
START UP!
TIMER TIME LIMIT:
20 minutes

20
18 2

16 4

14 6

12 8
10

design by ilias ahmed 30


TIME’S
START UP!
TIMER TIME LIMIT:
30 minutes

30

25 5

20 10

15

design by ilias ahmed 31

You might also like