This is a program that receives only a path to a text file which contains a list of tetrominoes and assembles them in order to create the smallest square possible.
#...
#...
#...
#...
....
....
..##
..##
ABB.
ABB.
A...
A...
- The file must have a .txt extension e.g text.txt, sample.txt
- The tetrominos must have a length of 4 i.e
...# 1
...# 2
...# 3
...# 4
- They must be separated by a new line i.e
...#
...#
...#
...#
...#
...#
...#
...#
- The length of each string must be 4.
- There must only be 4 hashes(#) to represent a valid tetromino.
-
This application requires Go (golang) 1.18 or higher to run. You can get it here
-
To clone and run this program, you'll need Git installed on your computer.
-
From the command line,
$ git clone https://learn.zone01kisumu.ke/git/josopondo/tetris-optimizer.git
$ cd tetris-optimizer
$ code .
-
Once the program has been installed, add your desired text file with the valid format to the directory containing
main.go
-
Run the program using the name of the text file added, like this:
$ go run . sample.txt
Fillit: Solving for the Smallest Square of Tetrominoes
Josephine Opondo |