Coder Social home page Coder Social logo

bsq's Introduction

bsq

Task - find the biggest square on the given map, avoiding obstacles.

As you may notice, this was a team of two project. Our algorythm was making the biggest square possible, given the sizes of initial map. Then it would start checking from top left corner going to the right, then down, if it doesn't meet the requirement of avoiding obstacles, as our task was to find one that is the closest to the top, then closest to the left edge of the map. Our small optimization was moving the current square to not just one step to the right, but over furthest obstaclem if it found one on the way. If initial square didn't find a space to fit in, one step smaller one would start its journey from the top left corner. If map comes from standard input, we would first write it to "temporary" file, then work with that file. I know that it's a terrible practice, as we later learned about writing files to lists, if we don't know the overall size beforehand, but it was the brightest idea at the time :)

P.S. there is also a test_files directory, which would give you an idea of what a valid map is

bsq's People

Contributors

kamialie avatar

Watchers

James Cloos 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.