New Feature - Explain code using AI

We have integrated OpenAI’s Codex onto CodeChef, so that you can now open user’s submissions (not just your own), and ask the AI to explain that code in English.

For example, after a contest is over, you can go to the Submissions tab of a problem and click on View all submissions, and click on the View button of a particular user’s submission. You should eventually be in a page like this - https://www.codechef.com/viewsolution/70530506.

Click on the “Analyze This Code” button, to get the AI’s output about this code:

Quite often, the explanation won’t be 100% accurate, as it is still very much in Beta mode. So, you can try the few different prompts available in the dropdown menu, and see which fits best.

Constraints:

  • Codes which are longer than 1000 characters are not supported.
  • A user can click on that button at most 10 times in any 24 hours. After that, it will be restricted. In a few weeks, this restriction will be relaxed for Pro users.
  • Depending on the usage, and the costs incurred by this, the restrictions could be made tighter in the future for non-Pro users.

It is important to remember that this is only a Beta feature, and we know that it often has incorrect explanations. It is meant only to supplement beginners in their learning process, and for curious users to play around with the AI engine.

8 Likes