Giter Site home page Giter Site logo

fillit's Introduction

fillit

Project is part of 42 curriculum made during my studies in Hive Helsinki school in partnership with @kyyninen.

Project aims at basic algorithmics. Searching for best possible solution among many options.

Input

Program takes a file as parameter, which contains a list of Tetriminos, or 4x4 text block-pieces consisting of four (tetro) filled-squares.

Screen Shot 2022-02-01 at 19 28 24

Validity of input has to be checked, rules for valid tetriminos are following:

  • Input consists only of empty character '.', filled character '#' and newlines
  • Tetriminos presented each on the block of 4 lines, each of which contains exactly 4 character and a newline
  • There is a newline between tetriminos blocks
  • Correct input consists of 1-26 tetriminos
  • There are exactly four '#' in one tetrimino block
  • Each '#' connected to at least one another '#' from top, down, left or right, but not diagonally

Here's some examples of non-valid input:

Screen Shot 2022-02-01 at 19 29 19

Aim

Goal of the program to find the smallest possible square that will fit all the tetriminoes from the input file. In order to that we are not allowed to rotate, flip or modify the tetriminoes in any way. Resulting square has to be printed out with capital letters starting with 'A' assigned to each tetrimino.

Example:

Screen Shot 2022-02-01 at 19 51 52

Out of all possible solutions the program must select the one that places tetriminos to the most upper-left position.

Screen Shot 2022-02-01 at 19 55 57

According to this rule, the correct answer is a).

Compilation

Downlaod the repo and run the make command from the root folder. Sample input files can be found is /sample folder.

fillit's People

Contributors

pavel-arkharov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.