Created
October 26, 2011 14:21
-
-
Save ludofleury/1316502 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exercice Tableaux | |
// | |
// Ajouter une variable de type Tableau (tabInventaire) qui contient ces valeurs dans l'ordre que vous voulez : | |
"epee"; | |
"dague"; | |
"fronde"; | |
"arc"; | |
"bombe"; | |
"fleche"; | |
"potion"; | |
"rien"; | |
var tabInventaire = new Array ( "epee", "dague", "fronde", "arc","rien", "bouteille") ; | |
var dernierObjet = tabInventaire.length | |
trace ( "inventaire complet : " + tabInventaire) | |
trace ( "premier objet : " + tabInventaire[0]); | |
trace ( "dernier objet : " + tabInventaire[tabInventaire.length-1]); | |
trace ( "taille totale de l'inventaire : " + tabInventaire.length); | |
// | |
// Puis tracer la première valeur du tableau et la dernière valeur | |
// /!\ ce tableau est ammené à évoluer. C'est à dire que la dernière valeur peut changer de position. | |
// Il faut CALCULER la position de la dernière valeur. | |
// | |
trace("Mon tableau entier : "+tabInventaire); | |
trace("Première valeur : "); | |
trace("Dernière valeur : "); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment