Lisp

Published on February 2017 | Categories: Documents | Downloads: 44 | Comments: 0 | Views: 209
of 2
Download PDF   Embed   Report

Comments

Content

UNMSM – FISI – Inteligencia Artificial

LISP
Operaciones Aritméticas:


Suma:
CLUSER 1 > (+ 5 6 4)
15



Resta
CLUSER 2 > (- 8 2)
6



Multiplicación
CLUSER 3 > (* 6 4)
24



División
CLUSER 4 > (- 22 2)
11

Asignación
CLUSER 5 > (setq a 2)
2
Máximo y Mínimo
CLUSER 6 > (max 5 9 1)
9
CLUSER 7 > (min 15 -5 12 8)
-5
Comparaciones
CLUSER 8 > (< 5 2)
NIL
CLUSER 9 > (/= 8 21)
NIL
CLUSER 10 > (equal 2 2)
T
Ejemplos:
1)

Jhonatan Cerna Valverde

UNMSM – FISI – Inteligencia Artificial
CLUSER 1 > (setq r 2)
2
CLUSER 2 > (setq s 9)
9
CLUSER 3 > (- r (* 8 (+ 2 s)))
-86
2)
CLUSER 4 > (setq a (max 5 6 7))
7
CLUSER 5 > (setq r (min 8 (+ 5 (* 2 4) 3) a)
7
3) CLUSER 6 > (equal (min 12 5 8) (* 5 1))
T

Jhonatan Cerna Valverde

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close