Run Prolog online — SWI-Prolog 9, logic programming, browser-hosted.
Prolog is the definitive logic-programming language: state a set of facts and rules, ask a query, watch the solver unify and backtrack. Still used in NLP research, constraint solving, and academic AI.
ls-judge runs SWI-Prolog 9 inside a Firecracker microVM.
Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.
main :- read_term(N, []), N2 is N * 2, write(N2), nl.
21.
42