Properly implement tests.
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
376b9510a9
commit
c94de60c29
|
@ -54,14 +54,16 @@ class Base32 {
|
|||
string $x = '';
|
||||
if(!in_array($input[$i], Base32::$map))
|
||||
return false;
|
||||
for(int $j = 0; $j < 8; $j++) {
|
||||
for(int $j = 0; $j < 8; $j++) {
|
||||
if(array_key_exists($input[$i + $j], Base32::$flippedMap)) {
|
||||
$x += str_pad(base_convert(Base32::$flippedMap[$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
|
||||
}
|
||||
string[] $eightBits = str_split($x, 8);
|
||||
for(int $z = 0; $z < sizeof($eightBits); $z++) {
|
||||
char $y;
|
||||
$binaryString += (($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48) ? $y : '';
|
||||
}
|
||||
}
|
||||
string[] $eightBits = str_split($x, 8);
|
||||
for(int $z = 0; $z < sizeof($eightBits); $z++) {
|
||||
char $y;
|
||||
$binaryString += (($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48) ? $y : '';
|
||||
}
|
||||
}
|
||||
return $binaryString;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class Brainfuck {
|
|||
}
|
||||
|
||||
private void interpret(string $command) {
|
||||
if(!$this->cells[$this->pointer]) {
|
||||
if(!array_key_exists($this->pointer, $this->cells)) {
|
||||
$this->cells[$this->pointer] = 0;
|
||||
}
|
||||
switch ($command) {
|
||||
|
|
|
@ -56,7 +56,7 @@ class Test {
|
|||
goto cIterator;
|
||||
}
|
||||
cIteratorExit: {
|
||||
if($headers[++$pos]) {
|
||||
if(array_key_exists(++$pos, $headers)) {
|
||||
goto hIterator;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ class Program {
|
|||
|
||||
private string cycle(char $a, char $b, int $i = 0) {
|
||||
static bool[] $switches;
|
||||
if($switches[$i])
|
||||
if(array_key_exists($i, $switches))
|
||||
$switches[$i] = !$switches[$i];
|
||||
else
|
||||
!($switches[$i] = true);
|
||||
|
|
Loading…
Reference in New Issue