Properly implement tests.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-07-01 20:07:06 +02:00
父節點 376b9510a9
當前提交 c94de60c29
簽署人: belliash
GPG Key ID: 4E829243E0CFE6B4
共有 4 個文件被更改,包括 11 次插入9 次删除

查看文件

@ -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);