Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int blocked(int x, int y, char d)
- {
- switch (d)
- {
- case 'N':
- Triple pN = new Triple(x, y, 'N');
- Triple pS = new Triple(x, y + 1, 'S');
- if (blocks.containsKey(pN) || blocks.containsKey(pS))
- return 0;
- return 1;
- case 'E':
- Triple pE = new Triple(x, y, 'E');
- Triple pW = new Triple(x + 1, y, 'W');
- if (blocks.containsKey(pE) || blocks.containsKey(pW))
- return 0;
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement