Example #1
0
 function map()
 {
     $this->clear();
     $start = $this->options['start_column'];
     $left = $start - $this->lines;
     if ($left < 0) {
         $left = 0;
     }
     $line = 0;
     for ($col = $start; $col > $left; $col--) {
         $this->set($line, $col, $this->options['character']);
         $line++;
     }
     return parent::map();
 }
Example #2
0
 function map()
 {
     $this->clear();
     $start = $this->options['start_column'];
     $right = $start + $this->lines;
     if ($right < $this->columns) {
         $right = $this->columns;
     }
     $line = 0;
     for ($col = $start; $col < $right; $col++) {
         $this->set($line, $col, $this->options['character']);
         $line++;
     }
     return parent::map();
 }
Example #3
0
 function map()
 {
     $this->clear();
     for ($l = 0; $l < $this->lines; $l++) {
         // line
         $line_columns = (int) (($this->lines - $l) / $this->lines * $this->columns);
         for ($c = 0; $c < $line_columns; $c++) {
             // character
             $x = 1.0 - $c / $line_columns;
             $y = 1.0 - $l / $this->lines;
             $r = Generator::random_0_1();
             $z = Generator::f($x, $y);
             if ($r > $z) {
                 $this->set($l, $c, $this->options['character']);
             }
         }
     }
     return parent::map();
 }