title: Sliding move generation using magic bitboard
body: <p>This is a question regarding the big picture of how to validate a sliding piece move in chess using magic bitboards. Just to clarify, I am not asking <em>how</em> magic bitboards work internally.</p>
  
  <p>Now, some more details about the question. I'm writing chess board representation using bitboard and I want to validate sliding piece moves using magic bitboards. Can somebody list the main steps of how to achieve that? As an example consider the following board position:</p>
  
  <p><img src="https://i.stack.imgur.com/QIcac.png" alt="White to move. Validate a given move for the rook on g3"></p>
  
  <p>Assume we have all magic bitboard functions and data structures initialised and ready to use. So using only the function signatures for magic bitboards, can you list the steps (pseudo code or any language) to validate a given move for the white rook on g3?</p>