generated from Flashky/advent-of-code-yyyy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
118 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/adventofcode/flashk/day16/MirrorLeftTile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.adventofcode.flashk.day16; | ||
|
||
import com.adventofcode.flashk.common.Vector2; | ||
|
||
import java.util.List; | ||
|
||
public class MirrorLeftTile extends Tile { | ||
|
||
public MirrorLeftTile(int row, int col) { | ||
super(row, col); | ||
} | ||
|
||
@Override | ||
public List<Vector2> nextDirections(Vector2 direction) { | ||
|
||
Vector2 newDirection = new Vector2(direction); | ||
|
||
if(RIGHT_DIRECTION.equals(direction) || LEFT_DIRECTION.equals(direction)) { | ||
newDirection.rotateLeft(); | ||
} else { | ||
newDirection.rotateRight(); | ||
} | ||
|
||
return List.of(newDirection); | ||
|
||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/adventofcode/flashk/day16/MirrorRightTile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.adventofcode.flashk.day16; | ||
|
||
import com.adventofcode.flashk.common.Vector2; | ||
|
||
import java.util.List; | ||
|
||
public class MirrorRightTile extends Tile { | ||
|
||
public MirrorRightTile(int row, int col) { | ||
super(row, col); | ||
} | ||
|
||
@Override | ||
public List<Vector2> nextDirections(Vector2 direction) { | ||
|
||
Vector2 newDirection = new Vector2(direction); | ||
|
||
if(RIGHT_DIRECTION.equals(direction) || LEFT_DIRECTION.equals(direction)) { | ||
newDirection.rotateRight(); | ||
} else { | ||
newDirection.rotateLeft(); | ||
} | ||
|
||
return List.of(newDirection); | ||
} | ||
|
||
} |
21 changes: 0 additions & 21 deletions
21
src/main/java/com/adventofcode/flashk/day16/MirrorTile.java
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
src/main/java/com/adventofcode/flashk/day16/MirrorTileLeft.java
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
src/main/java/com/adventofcode/flashk/day16/MirrorTileRight.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
src/main/java/com/adventofcode/flashk/day16/SplitterHorizontalTile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.adventofcode.flashk.day16; | ||
|
||
import com.adventofcode.flashk.common.Vector2; | ||
|
||
import java.util.List; | ||
|
||
public class SplitterHorizontalTile extends Tile{ | ||
|
||
public SplitterHorizontalTile(int row, int col) { | ||
super(row, col); | ||
} | ||
|
||
@Override | ||
public List<Vector2> nextDirections(Vector2 direction) { | ||
|
||
if(RIGHT_DIRECTION.equals(direction) || LEFT_DIRECTION.equals(direction)) { | ||
return List.of(direction); | ||
} | ||
|
||
return List.of(Vector2.left(), Vector2.right()); | ||
|
||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
src/main/java/com/adventofcode/flashk/day16/SplitterTile.java
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/main/java/com/adventofcode/flashk/day16/SplitterTileHorizontal.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
src/main/java/com/adventofcode/flashk/day16/SplitterTileVertical.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/main/java/com/adventofcode/flashk/day16/SplitterVerticalTile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.adventofcode.flashk.day16; | ||
|
||
import com.adventofcode.flashk.common.Vector2; | ||
|
||
import java.util.List; | ||
|
||
public class SplitterVerticalTile extends Tile { | ||
|
||
public SplitterVerticalTile(int row, int col) { | ||
super(row, col); | ||
} | ||
|
||
@Override | ||
public List<Vector2> nextDirections(Vector2 direction) { | ||
|
||
if(UP_DIRECTION.equals(direction) || DOWN_DIRECTION.equals(direction)) { | ||
return List.of(direction); | ||
} | ||
|
||
return List.of(Vector2.up(), Vector2.down()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters