John D. Cook 7/20/2026

Solving a chess puzzle with Grok 4.5

Read Original

This article evaluates Grok 4.5 by having it generate SWI Prolog and Lean 4 code to solve a chess puzzle: placing five white queens and three black queens on a 5x5 board so no queen attacks a queen of the opposite color. The Prolog code ran correctly on the first attempt, producing eight solutions. The Lean code required three iterations before running correctly, which the author notes is better than typical results with Claude. The article includes the full code listings and a representative solution. It is a technical tutorial and comparison of AI code generation capabilities for logic programming and formal verification, directly related to IT/technology.

Solving a chess puzzle with Grok 4.5

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet