« Guide du développeur » : différence entre les versions
Apparence
Aucun résumé des modifications |
|||
| Ligne 2 : | Ligne 2 : | ||
==[[Composants | Aide composants]]== | ==[[Composants | Aide composants]]== | ||
==Les unités algorithmiques== | ==Les unités algorithmiques== | ||
<syntaxhighlight lang="php" line> | |||
<?php | |||
/* | |||
* Réponse générique | |||
* @author Hugues GENVRIN | |||
*/ | |||
class unite{ | |||
public $calcul=0; | |||
public $tableau=array(); | |||
public function donnees($tab) { | |||
$i=0; | |||
while($i<count($tab)) | |||
{ | |||
$this->tableau[$i]=$tab[$i]; | |||
$this->calcul+=$this->tableau[$i]; | |||
$i++; | |||
} | |||
} | |||
public function output_1($input){ | |||
$this->donnees($input); | |||
$output_1 = $this->calcul; | |||
return $output_1; | |||
} | |||
public function output_0(){ | |||
$output_0 = "N/R"; | |||
return $output_0; | |||
} | |||
</syntaxhighlight> | |||
Version du 3 février 2026 à 09:32
Les unités algorithmiques
<?php
/*
* Réponse générique
* @author Hugues GENVRIN
*/
class unite{
public $calcul=0;
public $tableau=array();
public function donnees($tab) {
$i=0;
while($i<count($tab))
{
$this->tableau[$i]=$tab[$i];
$this->calcul+=$this->tableau[$i];
$i++;
}
}
public function output_1($input){
$this->donnees($input);
$output_1 = $this->calcul;
return $output_1;
}
public function output_0(){
$output_0 = "N/R";
return $output_0;
}