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

100
Views
How to improve the speed resetting a minimax chess board implementation?

I am programming a chess engine with minimax.

I use an array with 120 elements for the board. For every possible move, I have to create a copy of this array which is really slow without using bitboard.

Can I fasten this board copy part, e.g. using strings?

pisces.forEach(pisce=>{
    pisce.forEach(move=>{
          let copy=[...board]
          //other stuff
          board=copy
    })
})             
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Instead of copying the board, you could consider using a "do-undo" system:

pisces.forEach(pisce=>{
    pisce.forEach(move=>{
        play(board, move);
        //other stuff
        undo(board, move);
    })
})

NB: in chess you need also to keep track of whether castling is still allowed, en passent capture is allowed, how many moves have passed since the last capture, pawn or castling move (for applying the 50-move rule), ... So a move object should have enough information to set and undo such state changes.

about 4 years ago · Juan Pablo Isaza Report
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!