Playing Games That Have Educational Benefit
In general, the Hanafis are quite strict with games (even if without gambling), as most games fall under the category of ‘vain pursuits’ (lahw), which are disliked and sinful. [Nahlawi, Durar Mubaha]
However, some contemporary scholars mention that games will be allowed if they entail no unlawful elements (like gambling, etc.), do not distract from Allah’s remembrance or the ritual prayer, and do not prevent one from fulfilling their duties and responsibilities, both worldly and religious.
And Allah knows best.
Answered by: Shaykh Zain ul Aqtab Siddiqi of The Suyuti Institute