PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of zinsou A.A.E.Moïse   PHP Math Progression Handler   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: PHP Math Progression Handler
Detect and generate many types of number sequences
Author: By
Last change:
Date: 6 years ago
Size: 1,619 bytes
 

Contents

Class file image Download
<?php
require_once('progression.class.php');
require_once(
'detector.interface.php');
progression::include_native_detectors();



echo
'<pre>';

$x=progression::arithmetic(0,15,9);
$x->print_r();
var_dump(
$x->detect_type(),
$x->getNth(20));
var_dump($x->getNext(),$x->getNext(),$x->getNext());



$x=progression::geometric(1/8,9,6);
$x->print_r();

var_dump($x->detect_type(),$x->getNth(20));



$x=progression::arithmetico_geometric(0,15,9,6);
$x->print_r();
var_dump($x->detect_type(),$x->getNext(),$x->getNth(20));

 

$x=progression::collatz(1,15);
$x->print_r();
var_dump($x->detect_type(),$x->getNth(20),$x->neitherDecreasingNorIncreasing());




$x=progression::fibonacci(15);
$x->print_r();
var_dump($x->detect_type(),$x->getNth(14));



$x=progression::cauchy(15,9);
$x->print_r();
var_dump($x->detect_type(),$x->getNth(20));




$x=progression::harmonic(1/8,9,6);
$x->print_r();
var_dump($x->detect_type(),$x->getNth(20));




$x=progression::conway(15,9);
$x->print_r();
var_dump($x->detect_type(),$x->getNth(20));


$x=$x->reverse();
$x->addDetector([new reversed_conway($x),new Conway($x),new geometric($x),new cauchy($x),new collatz($x),new fibonacci($x),new arithmetic($x),new arithmetico_geometric($x),new harmonic($x)]);
$x->print_r();
var_dump($x->detect_type());


$y=progression::reversedConway($x[1],4);
$y->print_r();
$y->buildToNth(7);
$y->print_r();
var_dump($y->detect_type(),$y->getNth(10),$y->getNext());

$x=progression::randomNative();
$x->print_r();
var_dump($x->detect_type());

echo
'</pre>';



?>