Forum

Catégorie : Programmes
Forum : Les programmes des internautes
Vues : 1054
Réponses : 8
Type : discussion
Etat : réponses autorisées

UNE CHANCE DE CAPTURER LE POKEMON OU PAS [BETA PROGRAMME]

kevgaming57050 le 25/11/2015 à 23:26
Hey ; Après quasiment deux ans d’absence sur ce site je reviens avec un programme assez fun et pratique pour tout les pokéfans winkle.gif

En effet ce programme utilise une algorithme permettant de savoir si tu as 100% de chance ou pas de capturer un pokémon !
------------------------------------------------------------------------
LA FORMULE UTILISÉ :

PVmax est le nombre maximal de PV que peut avoir le Pokémon ;
PVactuel le nombre de PV actuels du Pokémon ;
t son taux de capture ;
bstatut est le bonus du statut :
1 si le statut du Pokémon n'est pas altéré,
1,5 s'il est paralysé, empoisonné ou brûlé,
2 s'il est endormi ou gelé ;
bball est le Bonus Ball de la Ball utilisée : 1 pour une Poké Ball, 1,5 pour une Super Ball, etc...
------------------------------------------------------------------------
Inutile pour certains ou utile pour d'autres je le trouve assez fun xD

Bien sur c'est une version 0.1 donc il y a encore pleins de trucs qui n'y sont pas ... :
-LES POKEMONS STATUS (TROP LONG A FAIRE CAR TROP DE POKEMON) les status pokémon sur ce site : http://goo.gl/ycuLcr
- NE FONCTIONNE POUR LE MOMENT QUE POUR LES :
-pokeball simple
-superball
-hyperball
-master ball
-et safari ball


KISS kiss.gif PS : Je n'ai pas vraiment cherché à raccourcir le programme au cas où des personnes m'en ferais la remarque ;D

LE CODE : (ps : "!=" signifie pas égal / "->" signifie sto )
Code
Lbl 0
Menu("POKEMONCAPTURE","GO !",1,"END",2
Lbl 1
ClrHome
Input "PV MAX POKEMON :",A
Input "PV ACTUEL :",B
If B>A
Then
   Disp "PV MAX>PV ACT!
   Pause
   Goto 1
   Else
Disp "POUR TAUX CAPTURE
Disp "VOIR SUR INTERNET
Input "TAUX CAPTURE:",D
Lbl RE
ClrHome
Disp "STATUT POKEMON :"
Disp "RIEN 1
Disp "PARA,EMPOI.1,5
Disp "ENDORMI GELE 2
Input "CHOIX :",C
If C!=1 and C!=1.5 and C!=2
Then
   Goto RE
   Else
   Goto SU
   Lbl SU
   ClrHome
      ((3*A-2*B)*D*1*C)/(3*A)->E
      ((3*A-2*B)*D*1.5*C)/(3*A)->F
      ((3*A-2*B)*D*2*C)/(3*A)->G
      ((3*A-2*B)*D*255*C)/(3*A)->H
   ClrDraw
   Text(1,1,"AVEC POKEBALL SIMPLE :
      If E>=255
   Then
      Text(8,1,"100 CHANCE"
      Goto AA
         Else
      If E<255
         Then
         Text(8,1,"CHANCE ALEATOIRE !
         Goto AA
         Lbl AA
            Text(15,1,"SUPER ET SAFARI BALL :
            If F>=255
            Then
            Text(22,1,"100 CHANCE"
            Goto BB
               Else
            If F<255
               Then
               Text(22,1,"CHANCE ALEATOIRE !
               Goto BB
               Lbl BB
                  Text(29,1,"HYPERBALL :
                  If G>=255
   Then
                  Text(36,1,"100 CHANCE"
                  Goto CC
                     Else
                  If G<255
                     Then
                     Text(36,1,"CHANCE ALEATOIRE !
                     Goto CC
                        Lbl CC
                        Text(43,1,"MASTERBALL :
                        If H>=255
   Then
                           Text(50,1,"100 CHANCE"
                           Goto DD
                           Else
                           If H<255
                           Then
                              Text(50,1,"CHANCE ALEATOIRE !
                              Goto DD
                              Lbl DD
                              Pause
                              Goto 0
                              Lbl 2
                           End
Mingerton le 26/11/2015 à 17:39
Pas mal ! Mais je pense qu'on peut l'améliorer winkle.gif

Pour commencer, voici ton code allégé :
Code
AxesOff
Lbl 0
Menu("POKEMONCAPTURE","GO !",1,"END",2
Lbl 1
ClrHome
Input "PV MAX POKEMON :",A
Input "PV ACTUEL :",B
If B>A
Then
   Disp "PV MAX>PV ACT!
   Pause
   Goto 1
End
Disp "POUR TAUX CAPTURE","VOIR SUR INTERNET
Input "TAUX CAPTURE:",D
Lbl RE
ClrHome
Disp "STATUT POKEMON :","RIEN 1","PARA,PSN. 1,5","ENDORMI GELE 2
Input "CHOIX :",C
If prod(C!={1,1.5,2
Goto RE
ClrHome
(3A-2B)DC/(3A
ClrDraw
Text(1,1,"AVEC POKEBALL SIMPLE :
If Ans>=255
Then
   Text(8,1,"100 CHANCE"
   Else
   Text(8,1,"CHANCE ALEATOIRE !
End
Text(15,1,"SUPER ET SAFARI BALL :
If 1.5Ans>=255
Then
   Text(22,1,"100 CHANCE"
   Else
   Text(22,1,"CHANCE ALEATOIRE !
End
Text(29,1,"HYPERBALL :
If 2Ans>=255
Then
   Text(36,1,"100 CHANCE"
   Else
   Text(36,1,"CHANCE ALEATOIRE !
End
Text(43,1,"MASTERBALL :
Text(50,1,"100 CHANCE"
End
Pause
Goto 0
Lbl 2
AxesOn
End


To noteras que j'ai dégagé le test de la Masterball, puisque c'est par définition impossible de rater avec elle ! J'ai aussi retiré l'affichage des axes, assez inesthétique.

Pourquoi ne pas donner le fameux taux, histoire que le dresseur puisse se faire une idée ?

Code
AxesOff
Lbl 0
Menu("POKEMONCAPTURE","GO !",1,"END",2
Lbl 1
ClrHome
Input "PV MAX POKEMON :",A
Input "PV ACTUEL :",B
If B>A
Then
   Disp "PV MAX>PV ACT!
   Pause
   Goto 1
End
Disp "POUR TAUX CAPTURE","VOIR SUR INTERNET
Input "TAUX CAPTURE:",D
Lbl RE
ClrHome
Disp "STATUT POKEMON :","RIEN 1","PARA,PSN. 1,5","ENDORMI GELE 2
Input "CHOIX :",C
If prod(C!={1,1.5,2
Goto RE
ClrHome
(3A-2B)DC/(3A
ClrDraw
Text(1,1,"AVEC POKEBALL SIMPLE :
Text(8,1,20Ans/51
Text(15,1,"SUPER ET SAFARI BALL :
Text(22,1,10Ans/17
Text(29,1,"HYPERBALL :
Text(36,1,40Ans/51
Text(43,1,"MASTERBALL :
Text(50,1,100
Pause
Goto 0
Lbl 2
AxesOn
End
adribaz le 27/11/2015 à 10:20
J'ai lus vos programme, on ne pa faire de Lbl avec plusieurs lettres, ils sont limitées que à une seule lettre karate.gif
Mingerton le 27/11/2015 à 13:40
Si, c'est possible à partir de la 82 Stats si je ne m'abuse winkle.gif
Ruadh le 27/11/2015 à 15:14
Bonjour ! Il y a quelques petits problèmes.

Code
Menu("POKEMONCAPTURE","GO !",1,"END",2
[...]
Lbl 2
End


Le End provoquera une erreur, il faut l'enlever.

Code
Lbl 1
[...]
If B>A
Then
Disp "PV MAX>PV ACT!
Pause
Goto 1
End


Il vaut mieux éviter les Goto après un then ou dans une boucle. Ceci est plus correct :

Code
If B>A
Pause "PV MAX>PV ACT!
If B>A
Goto 1


Voilà finalement une correction et optimisation du programme de Mingerton :

Code
AxesOff
Lbl 0
Menu("POKEMONCAPTURE","GO !",1,"END",2
Lbl 1
Repeat A>=B
ClrHome
Input "PV MAX POKEMON :",A
Input "PV ACTUEL :",B
If B>A
Pause "PV MAX>PV ACT!
End
Disp "POUR TAUX CAPTURE","VOIR SUR INTERNET
Input "TAUX CAPTURE:",D
Lbl R
ClrHome
Disp "STATUT POKEMON :","RIEN 1","PARA,PSN. 1,5","ENDORMI GELE 2
Input "CHOIX :",C
If prod(C!={1,1.5,2
Goto R
ClrHome
(3A-2B)DC/(15.3A
ClrDraw
Text(1,1,"AVEC POKEBALL SIMPLE :
Text(8,1,2Ans
Text(15,1,"SUPER ET SAFARI BALL :
Text(22,1,3Ans
Text(29,1,"HYPERBALL :
Text(36,1,4Ans
Text(43,1,"MASTERBALL :
Text(50,1,E2     //Le E de [2nde + ,]
Pause
Goto 0
Lbl 2
AxesOn
Mingerton le 27/11/2015 à 19:02
Rien à redire winkle.gif

Ca a du m'échapper, je suis pourtant du genre à mitrailler ce genre d'erreurs de vitesse tongue.gif
m@thieu41 le 02/12/2015 à 23:18
Mmh pour tester deux fois B>A je ne suis pas sur que ça vaille le coup winkle.gif

Des heures passées a espérer que cette pokeball tiendra le coup :p
Ruadh le 03/12/2015 à 18:14
C'est vrai que c'est pas très joli et que ça perd un octet, mais en général c'est mieux de l'écrire comme ça, même si pour ce programme c'est pas très important.
Sinon, j'avais pas remarqué, mais on peut remplacer cette partie par une boucle (j'ai édité le programme).
m@thieu41 le 03/12/2015 à 23:33
C'est important surtout pour les prgm qui bouclent, moins sinon winkle.gif