CodingKnight's blog

By CodingKnight, 9 months ago, In English

Hello Codeforces,

I posted this blog in CodeChef Discussion Forum few hours ago. I have just thought about posting it here for those interested in logic programming. CodeChef is distinguished in having Prolog among the available programming languages in its automatic judge system for competitive programming and problem solving.

I am a life-long lover for programming in Prolog, even though Prolog is not commonly used for competitive programming purposes. I noticed that the following sample solution for Prolog code does not identify explicitly the specific requirement for submitted Prolog code.

Prolog Sample Solution

In particular, the automatic judge requires that the entry point of the solution is predicate program/0. The following are sample accepted Prolog solutions.

1. ATM

2. Life, the Universe, and Everything

3. Factorial

Lines 3-22 in these accepted submissions include helper predicates for reading input data from the standard input stream.

CodeChef automatic judge uses presently version 7.2.3 of the free SWI-Prolog compiler, whose documentation is available online. The automatic judge returns a compilation error message if the submitted Prolog code does not include predicate program/0.

Learn Prolog Now is a good source for life-long learners who wish to learn about Prolog.

  • Vote: I like it
  • -16
  • Vote: I do not like it

9 months ago, # |
  Vote: I like it +11 Vote: I do not like it

Mentioning codechef here means downvotes only.