Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Detect insufficient material in chess game in JavaScript

I have created a Library for chess game in JavaScript.

In this library i decided that game should only be over when detect checkmate or insufficient material. Game is working properly for checkmate but I need to add function for detecting insufficient material condition to draw the game.

I have a object which is updated every time when one side piece kill piece of another side.

let count = {
   W: {
       K: 1,
       Q: 1,
       P: 8,
       R: 2,
       N: 2,
       B: 2,
   },
   B:{ /* Black piece */ }
} 

So my question is how can i detect a insufficient material using above object in JavaScript.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!