You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1.2 KiB

fill it

Objectives

Develop a program that receives only one argument, a txt file which will contain a list of Tetrominoes to assemble them in order to create the smallest square possible.

Instructions

All files referring to the project, must be in the same folder.

The program must :

  • Be written in Go
  • Compile successfully
  • Assemble all of the Tetrominoes in order to create the smallest square possible
  • Identify each Tetromino in the solution, by assigning different letters to different Tetrominoes
  • Expect at least 2 tetrominoes in the text file

Example of a text File

#...
#...
#...
#...

....
....
..##
..##
  • If it isn't possible to form a complete square, the program should leave spaces between the Tetrominoes. For example:
ABB.
ABB.
A...
A...

Usage

student@ubuntu:~/fill-it$ cat -e sample.txt
...#$
...#$
...#$
...#$
$
....$
....$
....$
####$
$
.###$
...#$
....$
....$
$
....$
..##$
.##.$
....$
$
....$
.##.$
.##.$
....$
$
....$
....$
##..$
.##.$
$
##..$
.#..$
.#..$
....$
$
....$
###.$
.#..$
....$
student@ubuntu:~/fill-it$ ./fillit sample.txt | cat -e
ABBBB.$
ACCCEE$
AFFCEE$
A.FFGG$
HHHDDG$
.HDD.G$
student@ubuntu:~/fill-it$