This is a program that receives only one argument, a path to a text file which will contain 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, mug.txt
- The tetrominos must have a length of 4 i.e
...# 1
...# 2
...# 4
...# 4
- They must be separated by an empty line i.e
...#
...#
...#
...#
...#
...#
...#
...#
- The length of each string must be 4
- There must only be 4 hashes(#) to represent a 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,
# clone this repository
$ git clone https://learn.zone01kisumu.ke/git/aosindo/tetris-optimizer.git
# go into the repository
$ cd tetris-optimizer
# open a code editor like VS Code
$ 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 . text.txt
Fillit: Solving for the Smallest Square of Tetrominoes
Andrew Osindo |