Advertisement
Guest User

Untitled

a guest
May 27th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. static void _SetStone(BOARD* pBoard, int x, int y) {
  2. int x0,y0, yMax;
  3. x0 = pBoard->checkedX;
  4. y0 = pBoard->checkedY;
  5. yMax = (pBoard->ActPlayer == 1) ? (NUM_CELL_Y - 1) : 0;
  6.  
  7. _InvalidateCell(x0, y0);
  8. if (_IsCorrectXY(x, y)) {
  9. if(pBoard->NextStep == 0 && (y == yMax)){
  10. pBoard->aCells[x][y] = (pBoard->ActPlayer + 2);
  11. }else{
  12. pBoard->aCells[x][y] = (pBoard->TypeStone == 1) ? pBoard->ActPlayer : pBoard->ActPlayer + 2 ;
  13. }
  14. pBoard->aCells[x0][y0] = 0;
  15. pBoard->checkedX = NUM_CELL_X;
  16. pBoard->checkedY = NUM_CELL_Y;
  17. _InvalidateCell(x, y);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement