Download the PHP package balsama/skyscrapers without Composer

On this page you can find all versions of the php package balsama/skyscrapers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package skyscrapers

Build Status

Skyscrapers

A php class to help you solve the Skyscrapers puzzles from NY Times Magazine.

Usage

Basic

$view = new View();

// There are four buildings per view, for a total of 24 purmutations.
$view->setBlocks(4);

// Only show permutations in which exactly three Skyscrapers are visible.
$view->setDesiredVisible(3);

// Only show permutuations where the fourth Skyscraper is of height 4
$view->addConstraint(4, "==", 4);

// Also, only show permutations where the second is greater than 1
$view->addConstraint(2, ">", 1);

// And the first is not 2
$view->addConstraint(1, "!=", 2);

// Get the solutions
$possibleSolutions = $view->getSolutions();

Description

A View is what one would see if standing at the end of a row or column on the puzzle-board. Instatiate a View:

$view = new View();

The number of total Skyscrapers in a view is set by the blocks() method. By default, there are three blocks in a view. The puzzles in NYTimes have been either 4 or 5 blocks long. To change the number of blocks:

$view->setBlocks($number_of_blocks);

The NYTimes puzzle provides the number of Skyscrapers visible for certain views. To set that number for the view, you can use the setDesiredVisible() method. By default it is 3. To change the desired number visible:

$view->setDesiredVisible($number_visible);

As you solve the puzzle, you'll come across situations where you know that certain blocks will hold a skyscraper of a certain height (or below or above a certain height). Constraints can be chained - that is, you can define more than one constraint without affecting previously defined constraints. To make the class aware of these, you can add a constraint. The addConstraint() method takes three arguments:

The following constrains the results to those which have a Skyscraper in the third block with a height of three:

$view->setConstraint(3, "==", 3);

Once you have the blocks, desired visible, and any constraints set, you can get the results with:

$view->getSolutions();

All versions of skyscrapers with dependencies

PHP Build Version
Package Version
Requires najidev/permutation Version ^1.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package balsama/skyscrapers contains the following files

Loading the files please wait ....