sleepy_coder

Direction Arrays

Nov 6th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. /**Possible Defined Arrays**/
  2. int move_4_side[4][2] = {{+1,0}, {0,+1}, {-1,0}, {0,-1}};//4 Direction
  3. int move_4_diagonal[4][2] = {{-1,-1}, {-1,+1}, {+1,+1}, {+1,-1}};///diagonal Direction
  4. int move_8_side[8][2] = {{0,+1}, {+1,+1}, {+1,0}, {+1,-1}, {0,-1}, {-1,-1}, {-1,0}, {-1,+1}};///8 Direction
  5. int knight_moves[8][2] = {{+2,+1}, {+1,+2}, {-1,+2}, {-2,+1}, {-2,-1}, {-1,-2}, {+1,-2}, {+2,-1}};///Knight Direction
  6. int days_in_months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
Advertisement
Add Comment
Please, Sign In to add comment