Skip to content

andyosyndoh/tetro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetris Optimizer

Description

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.

Example of a text File

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

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

Expected Output for the above Example

ABB.
ABB.
A...
A...

Guidelines for tetromino Text files Format

  1. The file must have a .txt extension e.g text.txt, mug.txt
  2. The tetrominos must have a length of 4 i.e
...# 1
...# 2
...# 4
...# 4
  1. They must be separated by an empty line i.e
...#
...#
...#
...#

...#
...#
...#
...#
  1. The length of each string must be 4
  2. There must only be 4 hashes(#) to represent a tetromino

Installation

  • 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 .

Usage

  • 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

Notion

Fillit: Solving for the Smallest Square of Tetrominoes

Enjoy!

Authors

Andrew/
Andrew Osindo

About

tetris optimizer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages