summaryrefslogtreecommitdiff
path: root/prolog/smallest.pl
diff options
context:
space:
mode:
authorGuillermo Ramos2012-05-03 14:12:06 +0200
committerGuillermo Ramos2012-05-05 14:35:04 +0200
commit4fb3fa2758fd4db2bef1efc7ae531e0dadaf4ffa (patch)
tree1b41602f30eab257d284008da13d0437b709c988 /prolog/smallest.pl
parenta36e9e7221841ffee75a8b35c07f3929240a0e17 (diff)
download7l-4fb3fa2758fd4db2bef1efc7ae531e0dadaf4ffa.tar.gz
[Prolog] Día 2
Diffstat (limited to 'prolog/smallest.pl')
-rw-r--r--prolog/smallest.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/prolog/smallest.pl b/prolog/smallest.pl
new file mode 100644
index 0000000..1a8835b
--- /dev/null
+++ b/prolog/smallest.pl
@@ -0,0 +1,4 @@
+smallest([H], H).
+smallest([H|T], S) :-
+ smallest(T, E),
+ (H<E -> S is H; S is E).