Recent public codes are listed below. You can filter them by the following programming languages:
- view
- All
- Ada
- Assembler
- Assembler
- AWK (gawk)
- AWK (mawk)
- Bash
- bc
- Brainf**k
- C
- C#
- C++
- C++0x
- C99 strict
- CLIPS
- Clojure
- COBOL
- COBOL 85
- Common Lisp (clisp)
- D (dmd)
- Erlang
- F#
- Factor
- Falcon
- Forth
- Fortran
- Go
- Groovy
- Haskell
- Icon
- Intercal
- Java
- JavaScript (rhino)
- JavaScript (spidermonkey)
- Lua
- Nemerle
- Nice
- Nimrod
- Objective-C
- Ocaml
- Oz
- Pascal (fpc)
- Pascal (gpc)
- Perl
- Perl 6
- PHP
- Pike
- Prolog (gnu)
- Prolog (swi)
- Python
- Python 3
- R
- Ruby
- Scala
- Scheme (guile)
- Smalltalk
- SQL
- Tcl
- Text
- Unlambda
- VB.NET
- Whitespace
-
1 2 3 4 5
foo( {-1/*_} ) if!'*/%'; print "Hello, Perl!\n" if<<'-- */' }). :- write('Hello, Prolog!'), nl, halt. /* -} x) = x main = putStrLn "Hello, Haskell!" -- */
-
1 2 3 4 5 6
foo( {-1/*_} ) if!'*/%'; print "Hello, Perl!\n" if<<'-- */' }). :- write('Hello, Prolog!'), nl, halt. /* -} x) = x main = putStrLn "Hello, Haskell!" -- */ END
-
1
? female ( mary ).
-
1
?- female ( mary ).
-
1 2
female( mary). ?- female ( mary ).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( X, Y) :- parent( X, Y), female( X). grandparent( X, Y) :- parent( X, Z), parent( Z, Y). ?- female ( mary ).
-
1 2 3 4 5
parent( mary, john ). parent( ann, mary ). female( mary). mother( X, Y) :- parent( X, Y), female( X). grandparent( X, Y) :- parent( X, Z), parent( Z, Y).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( X, Y) :- parent( X, Y), female( X). grandparent( X, Y) :- parent( X, Z), parent( Z, Y). ?- female ( mary ).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( X, Y) :- parent( X, Y), female( X). grandparent( X, Y) :- parent( X, Z), parent( Z, Y). ?- female (mary).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( X, Y) :- parent( X, Y), female( X). grandparent( X, Y) :- parent( X, Z), parent( Z, Y). ?-female (mary).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( X, Y) :- parent( X, Y), female( X). grandparent( X, Y) :- parent( X, Z), parent( Z, Y). ?-grandparent( ann, Z).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( X, Y) :- parent( X, Y), female( X). grandparent( X, Y) :- parent( X, Z), parent( Z, Y). ?-grandparent( ann, john ).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( X, Y) :- parent( X, Y), female( X). grandparent( X, Y) :- parent( X, Z), parent( Z, Y). ?-grandparent ( ann, john ).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( x, y) :- parent( x, y), female( x). grandparent( x, y) :- parent( x, z), parent( z, y). ?-grandparent ( ann, john ).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( x, y) :- parent( x, y), female( x). grandparent( x, y) :- parent( x, z), parent( z, y). ?- grandparent (ann,john).
-
1 2 3 4 5 6
parent( mary, john ). parent( ann, mary ). female( mary). mother( x, y) :- parent( x, y), female( x). grandparent( x, y) :- parent( x, z), parent( z, y). ?- grandparent (ann,john)
-
1 2 3 4 5
parent( mary, john ). parent( ann, mary ). female( mary). mother( x, y) :- parent( x, y), female( x). grandparent( x, y) :- parent( x, z), parent( z, y).
-
1
parent(Joe, Hannah).
-
1
parent (mary, john).
-
1
parent (mary, john).
-
1
parent(Joe, Hannah).
-
1
parent(mary, john).
-
1 2 3 4 5
parent( mary, john ). parent( ann, mary ). female( mary). mother( x, y) :- parent( x, y), female( x). grandparent( x, y) :- parent( x, z), parent( z, y).
-
1 2 3 4 5 6 7 8 9
% find the Zebra and the Water, zebra_water(X). % by Willem Robert van Hage, wrvhage@science.uva.nl right(2,1). right(3,2). right(4,3). right(5,4). nextdoor(X,Y) :- right(X,Y). nextdoor(X,Y) :- right(Y,X).
...
-
1
?-append([a], [b, c], L).
-
1
?-append ([a, b], [c], [a,b,c])
-
1
?-append ([a, b], [c], [a,b,c]).
-
1 2 3 4 5 6 7 8 9
prune(A, B) :- union(A, B, B). union([X|Y],Z,W) :- member(X,Z), !, /* do not use next clauses */ union(Y,Z,W). union([X|Y],Z,[X|W]) :- union(Y,Z,W). union([],Z,Z).
...
-
1 2 3 4 5 6 7 8 9
prune(A, B) :- union(A, B, B). union([X|Y],Z,W) :- member(X,Z), !, /* do not use next clauses */ union(Y,Z,W). union([X|Y],Z,[X|W]) :- union(Y,Z,W). union([],Z,Z).
...
-
1 2 3 4 5 6 7 8 9
prune(A, B) :- union(A, B, B). union([X|Y],Z,W) :- member(X,Z), !, /* do not use next clauses */ union(Y,Z,W). union([X|Y],Z,[X|W]) :- union(Y,Z,W). union([],Z,Z).
...


