<?php
ini_set('default_charset','utf-8');
require 'romanNumbers.php';
$rn = new romanNumbers;
#/* Typentest:
1,
4,
6,
9,
10,
11,
14,
16,
20,
30,
40,
50,
90,
111,
140,
149,
1444,
1661,
14444,
16661,
144444,
166666
);
foreach ( $zahlen as $zahl ) {
$e = $rn -> getRoman ( $zahl,true, true); echo $e, "\t( $zahl , true, true )\t(" . $rn -> getDec ($e). ") \n";
$e = $rn -> getRoman ( $zahl ,true, false); echo $e, "\t( $zahl ,true, false )\t(" . $rn -> getDec ($e). ") \n";
$e = $rn -> getRoman ( $zahl ,false, true); echo $e, "\t( $zahl ,false, true )\t(" . $rn -> getDec ($e). ") \n";
$e = $rn -> getRoman ( $zahl ,false, false); echo $e, "\t( $zahl ,false, false )\t(" . $rn -> getDec ($e). ") \n";
}
'I',
'IIII',
'IV',
'VIIII',
'IX',
'XI',
'XIIII',
'XIV',
'LXXXX',
'XC',
'MCCCCXXXXIIII',
'MCDXLIV',
'ↈↂↂↂↂMMMMCCCCXXXXIIII',
'ↈↂↇMↁCDXLIV',
'ↈↂↂↂↂMMMMCCCCXXXXIIII',
'ↈↂↇMↁCDXLIV',
'(((I)))((I))((I))((I))((I))MMMMCCCCXXXXIIII'
);
foreach ( $strings as $string ) {
echo $rn -> getDec ($string) , "\t( $string )\n";
}
#*/
/* Geschwindigkeit:
ob_start();
$startTime=microtime(1);
for ( $i = 1; $i < 100001; $i++ ) {
$s = $rn -> getRoman( $i, false );
$l = $rn -> getRoman( $i, false );
$d = $rn -> getDec( $s );
if ($d != $i) {
echo "ERROR ( $i != $d\t$s\t$l )\n";
} else {
echo "FINE ( $i != $d\t$s\t$l )\n";
}
}
echo "TIME: ", (microtime(1) - $startTime)/60*1000 , " Microsekunden pro Berechnung. \n";
#*/