Free Ideone API
try it now!
Your great ideas will be born here
Recent public pastes are listed below. You can filter them by the following programming languages:
- view
- All
- Ada
- Assembler
- AWK (gawk)
- AWK (mawk)
- Bash
- bc
- Brainf**k
- C
- C#
- C++
- 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
- Ocaml
- Oz
- Pascal (fpc)
- Pascal (gpc)
- Perl
- Perl 6
- PHP
- Pike
- Prolog (gnu)
- Prolog (swi)
- Python
- Python 3
- R
- Ruby
- Scala
- Scheme (guile)
- Smalltalk
- Tcl
- Text
- Unlambda
- Visual Basic .NET
- Whitespace
-
1
1+1.
-
1
1+1ю
-
1
prewed!
-
1 2 3 4 5 6 7 8 9
%married block married(janne,viktor). married(ulve,aksel). married(elvi,johannes). %mother block mother(diana,janne). mother(janne,ulve). mother(peeter,ulve).
...
-
1 2 3 4 5 6 7
female(mary). loves(jane, wine). loves(john, X) :- loves(X, wine). loves(john, X) :- female(X). loves(john, wine). loves(mary, wine). ?- loves(john, X).
-
1 2 3 4 5 6 7
female(mary). loves(jane, wine). loves(john, X):- loves(X, wine). loves(john, X):- female(X). loves(john, wine). loves(mary, wine). ?- loves(john, X).
-
1 2 3 4 5 6 7
female(mary). loves(jane, wine). loves(john, X):- loves(X, wine). loves(john, X):- female(X). loves(john, wine). loves(mary, wine). ?-loves(john, X).
-
1 2 3 4 5 6 7
rel(a1,b1). rel(a2,b2). rel(b2,c2). associatedWith(X,Y,Z) :- rel(X,Y),rel(Y,Z). ?- associatedWith(X,Y,Z).
-
1 2
g. a :- g.
-
1 2 3 4
program :- get_char(X),get_char(Y),check(X,Y). check('4','2'):-!. check(X,Y):-write(X),get_char(Z),check(Y,Z). :- program.
-
1
program :- get_char(X),write(X).
-
1
program :- get_char(X),write(X).
-
1
program :- get_char(X),write(X).
-
1 2 3 4 5 6
clauses true(A, true) :- A. false(A, false) :- A. goal true(A).
-
1 2 3 4 5 6 7 8 9
alergica(clara). gusta_rock(maria). gusta_rock(luisa). conoce(luisa, X, Ts) :- test_trabaja(florista, X, Ts). conocen(X, X, _) :- !, fail. conocen(X, Y, Ts) :- conoce(X, Y, Ts). conocen(X, Y, Ts) :- conoce(Y, X, Ts). test_trabaja(T, X, Ts) :- member(tr(T,X), Ts).
...
-
1
fact(X) :- write("Here").
-
1
fact(w).
-
1 2 3
fact(w). is_true(X) :- fact(X). is_true(a)?
-
1 2 3
fact(w). is_true(X) :- fact(X). is_true(a).
-
1 2 3
fact(w). is_true(X) :- fact(X).
-
1 2 3
fact(w) is_true(X) :- fact(X).
-
1 2 3
fact(w); is_true(X) :- fact(X);
-
1 2 3
fact(W); is_true(X) :- fact(X);
-
1 2 3
program :- readln(X),runtest(X). runtest([0]). runtest([X]) :- write(X),nl, X2 is -(X,1), runtest([X2]).
-
1 2 3 4 5 6 7 8 9
program :- readln(X), runtest(X). runtest([0]). runtest([X]) :- execute, X2 is -(X,1),runtest([X2]). execute :- readln(A), readln(B),
...
-
1 2 3 4
mother(red,mij). mother(M,mij).
-
1
mother(red,mij).
-
1
mother(red,mij)
-
1 2 3 4 5 6 7
eval_v(A+B,CV,Vars):-eval_v(A,AV,Vars),eval_v(B,BV,Vars),CV is AV+BV. eval_v(A-B,CV,Vars):-eval_v(A,AV,Vars),eval_v(B,BV,Vars),CV is AV-BV. eval_v(A*B,CV,Vars):-eval_v(A,AV,Vars),eval_v(B,BV,Vars),CV is AV*BV. eval_v(Num,Num,Vars):-number(Num). eval_v(Var,Value,Vars):-atom(Var),member(Var/Value,Vars). ?-eval_v(2*a+b,Val,[a/1,b/5]).
-
1
hello :- display('Hello World!') , nl .
