Code visual basic

cs_mije Messages postés 1 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 14 mai 2004 - 14 mai 2004 à 20:41
girloftheangel Messages postés 3 Date d'inscription mardi 11 mai 2004 Statut Membre Dernière intervention 16 avril 2010 - 15 mai 2004 à 21:29
URGENT !!!!
JE suis a la recherche du code visual basic pour creer le jeu memory
merci

2 réponses

l0st3d Messages postés 205 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 13 novembre 2009
15 mai 2004 à 03:55
'De un, dans un module.
public type MemoryG
Zone(1 to 64) as integer 'Tu peut aussi mettre un string
end type

Public Game as MemoryG

public function CréeJeux()
dim i as integer
dim NewMemory as integer
i=1
while i < 65
ReNew:
NewMemory = Round(rnd * 32)
if HasDoubleValue(NewMemory, I) = True then: goto ReNew
Game(i) = NewMemory
i=i+1
Wend
End function

public function HasDoubleValue(Value as integer, ZoneCount as integer) as Boolean
dim i as integer, vCount as integer
i = 1
while i < ZoneCount + 1 if Game.Zone(i) Value then: vCount vCount + 1 if vCount 2 then: HasDoubleValue True: Exit function
i=i+1
wend
HasDoubleValue = False
End function

public function VerifCombin(Zone1 as integer, Zone2 as Integer) as boolean
if Game.Zone(Zone1) = Game.Zone(Zone2) then
VerifCombin = True
else
VerifCombin = False
end if

'ICI C'est le code que tu devrais inserer dans une forme, crée un picturebox et enregistre son Index a 0 (pour permettre la création de nouveau controle) et tu en recrée 64 (+ ou moin)

Option Explicit
Private InMEM as integer
Private Picture1_Click(Index as integer)
if InMEM = 0 then
InMEM = Index
else
if VerifCombin(Index,InMEM) = True then
MsgBOX "Résultat OK"
Unload Picture1(Index)
Unload Picture1(InMEM)
DoEvents
else
MshBox "Résultat incorrect"
end if
InMEM = 0
end if
end function

'Voila je te laisse faire le reste, Note que j'ai fait ce code main lever donc il peut y avoir des bug
Bonne Chance
0
girloftheangel Messages postés 3 Date d'inscription mardi 11 mai 2004 Statut Membre Dernière intervention 16 avril 2010
15 mai 2004 à 21:29
Quelqu'un sais comment je pourrais faire pour arranger l'annimation flash de sloche.com ( Http://www.sloche.com/client/sloche.swf ) comme jouer avec la vitesse et autre bidules. (le site est protégé)
0
Rejoignez-nous