hair loss drug

Inspirated

 
 

July 2, 2008

Programming Challenges: Check the Check

Filed under: Blog — admin @ 7:55 pm

PC/UVa IDs: 110107/10196, Popularity: B, Success rate: average, Level: 1

I had two approaches in mind for checking the check before solving this problem:

  • return a flag value from the move-generation functions as soon as opponent’s king is encountered in a reachable square.
  • Generate all reachable squares for a side first, and then check whether opponent’s king is positioned on one.

I opted for the latter because even though it was more performance-intensive, it made my move-generation functions more generic and appropriate for extensibility.
(more…)

Tags: , , , , , , , , , , , , , , , , ,