2017 © Pedro Peláez
 

library algorithm

Class with algorithms to solve and display mathematical sequences.

image

josantonius/algorithm

Class with algorithms to solve and display mathematical sequences.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

PHP Algorithm class

Latest Stable Version License PSR2 PSR4 CodeCov, (*1)

Translations: Español, (*2)

Class with algorithms to solve and display mathematical sequences., (*3)



Requirements

This class is supported by PHP versions 5.6 or higher and is compatible with HHVM versions 3.0 or higher..., (*4)

Installation

The preferred way to install this extension is through Composer., (*5)

To install PHP Algorithm class, simply:, (*6)

composer require josantonius/algorithm

The previous command will only install the necessary files, if you prefer to download the entire source code you can use:, (*7)

composer require josantonius/algorithm --prefer-source

You can also clone the complete repository with Git:, (*8)

git clone https://github.com/josantonius/php-algorithm.git

Or install it manually:, (*9)

Download Algorithm.php:, (*10)

wget https://raw.githubusercontent.com/josantonius/php-algorithm/master/src/Algorithm.php

Available Methods

Available methods in this class:, (*11)

Algorithm::lookAndSay($lastSequence, $maxLines);
Attribute Description Type Required Default
$lastSequence Initial value to start the sequence int No 1
$maxLines Maximum lines number to show int No 15

# Return (string) → Sequence., (*12)

Quick Start

To use this class with Composer:, (*13)

require __DIR__ . '/vendor/autoload.php';

use Josantonius\Algorithm\Algorithm;

Or If you installed it manually, use it:, (*14)

require_once __DIR__ . '/Algorithm.php';

use Josantonius\Algorithm\Algorithm;

Usage

Example of use for this class:, (*15)

echo Algorithm::lookAndSay();

/*
1
11
21
1211
111221
312211
13112221
1113213211
31131211131221
13211311123113112211
11131221133112132113212221
3113112221232112111312211312113211
1321132132111213122112311311222113111221131221
11131221131211131231121113112221121321132132211331222113112211
311311222113111231131112132112311321322112111312211312111322212311322113212221
*/
echo Algorithm::lookAndSay(22, 5);

/*
22
22
22
22
22
*/

Tests

To run tests you just need composer and to execute the following:, (*16)

git clone https://github.com/josantonius/php-algorithm.git
cd php-algorithm
composer install

Run unit tests with PHPUnit:, (*17)

composer phpunit

Run PSR2 code standard tests with PHPCS:, (*18)

composer phpcs

Run PHP Mess Detector tests to detect inconsistencies in code style:, (*19)

composer phpmd

Run all previous tests:, (*20)

composer tests

Changelog

Detailed changes for each release are documented in the release notes., (*21)

Contribution

Please make sure to read the Contributing Guide, before making a pull request, start a discussion or report a issue., (*22)

Thanks to all contributors to this project! :heart:, (*23)

If you found this interesting, you can become my sponsor! :blush:, (*24)

License

This project is licensed under the MIT License., (*25)

Copyright © 2017-2022, Josantonius, (*26)

The Versions

06/01 2018

dev-master

9999999-dev

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm algorithms mathematical sequences look-and-say conway constant

06/01 2018

1.1.6

1.1.6.0

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm algorithms mathematical sequences look-and-say conway constant

12/11 2017

1.1.5

1.1.5.0

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm algorithms mathematical sequences look-and-say conway constant

08/11 2017

1.1.4

1.1.4.0

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm algorithms mathematical sequences look-and-say conway constant

14/09 2017

1.1.3

1.1.3.0

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm algorithms mathematical sequences look-and-say conway constant

18/07 2017

1.1.2

1.1.2.0

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

php hhvm algorithms mathematical sequences look-and-say conway constant

18/03 2017

1.1.1

1.1.1.0

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

php hhvm algorithms mathematical sequences look-and-say conway constant

30/01 2017

1.1.0

1.1.0.0

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

php hhvm algorithms mathematical sequences look-and-say conway constant

30/01 2017

1.0.0

1.0.0.0

Class with algorithms to solve and display mathematical sequences.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

php hhvm algorithms mathematical sequences look-and-say conway constant