Esempio n. 1
0
 function printCard($cfg)
 {
     $suit = self::$suits[$cfg->charset][$this->suit];
     if ($cfg->charset == CHARSET_REAL) {
         $suit = html_entity_decode($suit, ENT_COMPAT, 'UTF-8');
     }
     $val = $this->face;
     $ret = " {$val}{$suit}";
     if ($this->suit > 2) {
         $col = 'red';
     }
     if ($cfg->color && $col) {
         $c = new Color();
         $ret = $c->red($ret);
     }
     return $ret;
 }
Esempio n. 2
0
 /**
  * @param \OttawaDeveloper\Tools\ColorAnalyzer\Color $compareTo
  * 
  * @return boolean
  */
 public function equals(Color $compareTo)
 {
     return $compareTo->red() === $this->red() && $compareTo->green() === $this->green() && $compareTo->blue() === $this->blue() && $compareTo->alpha() === $this->alpha();
 }
Esempio n. 3
0
        $prefix = file_get_contents($dir . 'prefix');
    }
    if (file_exists($dir . 'suffix')) {
        $suffix = file_get_contents($dir . 'suffix');
    }
    foreach (test_files($dir) as $file) {
        $total++;
        list($src, $result) = read_test($file);
        $result = trim($result);
        $eval_out = trim(eval_output($prefix . $src . $suffix));
        if ($eval_out == $result) {
            $correct++;
            echo '.';
        } else {
            add_error($file, $eval_out, $result);
            $fail++;
            echo 'e';
        }
    }
}
print_all_errors();
if ($fail) {
    Color::red();
} else {
    Color::green();
}
puts("Correct: " . $correct);
puts("Fail: " . $fail);
puts("Total: " . $total);
Color::reset();
unlink('tmp.php');