SHOW:
|
|
- or go back to the newest paste.
| 1 | - | <html> |
| 1 | + | <?php |
| 2 | - | <head> |
| 2 | + | $armurerie= array("epee" => 50, "bouclier" => 35, "armure" => 85, "marteau" => 50, "dague" => 25, "shuriken" => 5);
|
| 3 | - | <title>Ma super calculatrice</title> |
| 3 | + | |
| 4 | - | <style> |
| 4 | + | function tri($tab) |
| 5 | - | body |
| 5 | + | {
|
| 6 | foreach ($tab as $key => $value) | |
| 7 | - | background-color: black; |
| 7 | + | |
| 8 | $taille = count($tab); | |
| 9 | for($i = 1; $i < $taille; $i++) | |
| 10 | - | #calculatrice |
| 10 | + | |
| 11 | for($j = $taille-2; $j >= $i; $j--) | |
| 12 | - | border: 2px solid black; |
| 12 | + | |
| 13 | - | border-radius: 15px; |
| 13 | + | if($tab[$j+1] < $tab[$j]) |
| 14 | - | margin-left: auto; |
| 14 | + | |
| 15 | - | margin-right: auto; |
| 15 | + | $temp = $tab[$j+1]; |
| 16 | - | width: 400px; |
| 16 | + | $tab[$j+1] = $tab[$j]; |
| 17 | - | height: 600px; |
| 17 | + | $tab[$j] = $temp; |
| 18 | - | background-color: white; |
| 18 | + | |
| 19 | - | margin-top: 50px; |
| 19 | + | |
| 20 | - | padding: 10px; |
| 20 | + | |
| 21 | } | |
| 22 | } | |
| 23 | - | #calculatrice form |
| 23 | + | |
| 24 | tri($armurerie); | |
| 25 | - | font-size: 30px; |
| 25 | + | |
| 26 | - | font-weight: bold; |
| 26 | + | |
| 27 | - | margin-top: 20px; |
| 27 | + | var_dump($armurerie); |
| 28 | ?> |