Back to problems

Babylon Tile-Stack Merge Game

Object-Oriented Programming · Google · Hard

Requirements Begin with 12 tiles arranged as twelve separate stacks, each of height 1. The tiles use four colors: Y, W, G, and B, with three tiles of each color. Two players take turns making moves. A move selects two existing stacks and places one complete stack on top of the other. The move is allowed when either the stacks have equal heights or their top tiles have the same color. Once combined, the resulting stack's height is the sum of both heights, and its top color is…

Checking your access…