-
Any living character with fewer than two living family members dies, as if their House became extinct.
-
Any living character with two or three living family members, lives on to the next episode.
-
Any living character with more than three living family members dies, as if by assassination.
-
Any dead character with exactly three living family members is reanimated, as if by the Night King.
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
import java.util.List; | |
import java.util.function.BiFunction; | |
import java.util.function.Function; | |
import static java.util.Arrays.asList; | |
public class Combinators { | |
public static <A, B, R> BiFunction<B, A, R> flip(BiFunction<A, B, R> fn) { |
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
with recursive generation1(x,y) as ( --the initial board setup | |
select 2, 3 | |
union | |
select 3, 3 | |
union | |
select 4, 3 | |
), | |
game(n, x, y) as ( | |
select 1, x, y from generation1 -- generation 1 is initial board setup | |
union all |