Exemplo n.º 1
0
 private function getRandomNumber($min, $max, VectorInterface $list)
 {
     do {
         $number = mt_rand($min, $max);
     } while ($list->contains($number));
     return $number;
 }
Exemplo n.º 2
0
 /**
  * @param VectorInterface $guess
  * @param VectorInterface $secret
  * @return Dictionary
  */
 public function myGuessScore(VectorInterface $guess, VectorInterface $secret)
 {
     foreach ($guess as $key => $guessNumber) {
         if ($secret->contains($guessNumber)) {
             $valueSecret = $secret->tryGet($key);
             if ($valueSecret == $guessNumber) {
                 $this->guessGreat++;
                 continue;
             }
             $this->guessNice++;
             continue;
         }
         $this->guessBad++;
     }
     return $this->guessGreat == $secret->count();
 }
Exemplo n.º 3
0
 public function removeReservado($cnab)
 {
     $this->reservados->remove($cnab);
     return $this;
 }
 public function removeBranco($zeros)
 {
     $this->brancos->remove($zeros);
     return $this;
 }
 public function removeOcorrencia($ocorrencia)
 {
     $this->ocorrencias->remove($ocorrencia);
     return $this;
 }
 /**
  * Remove um lote.
  * @param LoteInterface $lote
  * @return Retorno
  */
 public function removeLote(LoteInterface $lote)
 {
     $this->lotes->remove($lote);
     return $this;
 }
Exemplo n.º 7
0
 /**
  * Remove um detalhe do lote.
  * @param CnabDetailInterface $detail
  * @return Lote
  */
 public function removeDetail(CnabDetailInterface $detail)
 {
     $this->details->remove($detail);
     return $this;
 }
 public function removeUsoBanco($usoBanco)
 {
     $this->usoBanco->remove($usoBanco);
     return $this;
 }
Exemplo n.º 9
0
 public function removeComplemento($complemento)
 {
     $this->complementos->remove($complemento);
     return $this;
 }