arthur-zhuk / fillit

Backtracking Based Tetrimino Smallest Box Finder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fillit - The Smallest Square Finder!

##developed by: Zackary Smith & Arthur Zhuk

fillit is project that allows for searching for the optimal solution among a large set of tetrimino piece possibilities. fillit features an algorithm which fits tetriminos together into the smallest possible square grid.

A tetrimino is a 4 block geometric figure as found in the game Tetris. alt text

fillit doesn't consist of recoding Tetris but rather taking in a file as an argument which contains a list of tetriminos which are 4x4 in size. Our approach to finding the smallest possible square the pieces could fit into involves implementing a backtracking algorithm. The backtracking algorithm traverses the map grid using the first empty '.' that correlates with a tetrimino grid looking for a free spot. It recurisvely performs checks to move the tetrimino to the correct location and make the placement. Afterwards the algorithm moves on to the next piece in the input.

The input is passed in as shown below.

input i.e: alt text result i.e: alt text

The above result concludes the smallest box grid the tetriminos can fit in is 6 by 6 in dimensions.

About

Backtracking Based Tetrimino Smallest Box Finder


Languages

Language:C 92.5%Language:Shell 5.3%Language:Makefile 2.2%