private function getRandomNumber($min, $max, VectorInterface $list) { do { $number = mt_rand($min, $max); } while ($list->contains($number)); return $number; }
/** * @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(); }
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; }
/** * 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; }
public function removeComplemento($complemento) { $this->complementos->remove($complemento); return $this; }