Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hasMatch():Boolean {
- var currentCellType = getType(i, j);
- for (var i:int = 0; i < 5; i++) {
- for (var j:int = 0; j < 5; j++) {
- if (i > 0) {
- var nextCellType = getType(i + 2, j);
- var hasHorizontalMatch:Boolean = nextCellType == currentCellType;
- if (hasHorizontalMatch && getType(i + 1) == currentCellType) {
- return true;
- }
- }
- if (i < 5) {
- nextCellType = getType(i - 2, j);
- hasHorizontalMatch = nextCellType == currentCellType;
- if (hasHorizontalMatch && getType(i - 1) == currentCellType) {
- return true;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement