Menu

 
Reply to this topicStart new topic
> Visual basic...............euromilhoes...........
V
Kacetada
post Feb 25 2006, 05:08 PM
Post #1




Grupo: Membro
Posts: 210
Registado: 23-February 06
Membro nº: 668





Dim chave(1 To 5) As Integer

Dim estrela(1 To 2) As Integer



Private Sub Command1_Click()

     Randomize



     For i = 1 To 5

          chave(i) = Int(Rnd * 50) + 1

     Next



     'Randomize



     For i = 1 To 2

          estrela(i) = Int(Rnd * 9) + 1

     Next



     On Error GoTo erro



     soma = 0



     For i = 1 To 5

          For j = 1 To 5

               If chave(i) = Text1(j) Then

                    soma = soma + 1

               End If

          Next

     Next



     soma1 = 0



     For i = 1 To 2

          For j = 1 To 2

               If estrela(i) = Text2(j) Then

                    soma1 = soma1 + 1

               End If

          Next

     Next



     Picture1.Cls

     Picture1.Print "numeros"



     For i = 1 To 5

          Picture1.Print chave(i)

     Next



     Picture1.Print "estrelas"



     For i = 1 To 2

          Picture1.Print estrela(i)

     Next



     MsgBox ("acertou " & soma & " numeros e " & soma1 & " estrelas")

Exit Sub



erro:

     MsgBox ("nao intruduziu os numero ou parte deles")

End Sub
Go to the top of the page
 
+Quote Post
cenourinha
post Feb 25 2006, 05:10 PM
Post #2


Vegetal ambulante
Ícone do grupo

Grupo: Super Administrador
Posts: 10,926
Registado: 26-July 05
De: Barcelos, Portugal
Membro nº: 52



Muito bom, pelos conhecimentos que tenho o codigo tá simples e certo!


--------------------
God almighty
Go to the top of the page
 
+Quote Post
City
post Mar 1 2006, 11:45 PM
Post #3




Grupo: Membro
Posts: 2
Registado: 1-March 06
Membro nº: 722



Ta mal tens 1 ponto a mais. de resto esta bem : mota :
Go to the top of the page
 
+Quote Post
BigPower
post Mar 2 2006, 12:14 AM
Post #4




Grupo: Membro
Posts: 5,145
Registado: 27-August 05
Membro nº: 70



Bem-vindo City!


--------------------
Go to the top of the page
 
+Quote Post
itmaster
post Mar 19 2006, 11:35 PM
Post #5




Grupo: Membro
Posts: 5
Registado: 17-March 06
Membro nº: 841



: bom trabalho :
O codigo não está mal, mas podias evoluir e tentar fazer uma coisa baseada num dos sistemas de probabilidades, para determinar quais os proximos números.
Go to the top of the page
 
+Quote Post
putonarc
post Jun 9 2006, 07:44 PM
Post #6




Grupo: Membro
Posts: 41
Registado: 29-April 06
Membro nº: 1,286



eu nAO PERCEBI ISSO PODIAM EXPLIKAR


--------------------

CLIQUE NA SIGN PARA IR PARA O SITE
Go to the top of the page
 
+Quote Post
cocacola
post Jun 9 2006, 07:59 PM
Post #7




Grupo: Membro
Posts: 764
Registado: 26-April 06
Membro nº: 1,255



muito bom
Go to the top of the page
 
+Quote Post
lycosman
post Jun 10 2006, 05:16 AM
Post #8



Ícone do grupo

Grupo: Moderador
Posts: 3,762
Registado: 27-July 05
De: Fátima/Leiria
Membro nº: 14



Não testei, mas deve funcionar. Se bem que podia estar mais organizadito... Picture1 e Command1? Um programador dá nomes às coisas, por mais basaroucos que sejam... wink.gif


--------------------
"Think today's world, where Apple is the innovative underdog, Google is the company that does no evil, and Microsoft sits atop its throne as ruler of an evil empire. Will this state of affairs last forever? Apple and Google will also be hated someday..." by Someone

"It's not about ego. Really. If it was ego, I'd be telling you about my awesome... oh, never mind." By Bruce Perens

lycosman @ Twitter

Go to the top of the page
 
+Quote Post
cenourinha
post Jun 10 2006, 07:02 AM
Post #9


Vegetal ambulante
Ícone do grupo

Grupo: Super Administrador
Posts: 10,926
Registado: 26-July 05
De: Barcelos, Portugal
Membro nº: 52



Tipo, isto é só meter no compilador e F5 ?
Ou precisa de alguma coisa adicional?


--------------------
God almighty
Go to the top of the page
 
+Quote Post
lycosman
post Jun 10 2006, 12:59 PM
Post #10



Ícone do grupo

Grupo: Moderador
Posts: 3,762
Registado: 27-July 05
De: Fátima/Leiria
Membro nº: 14



(cenourinha)
Tipo, isto é só meter no compilador e F5 ?
Ou precisa de alguma coisa adicional?


Precisas de criar uma picturebox chamada Picture1, um botão chamado Command1 e duas text boxes, uma chamada Text1 e outra Text2. Estes nomes vêm por defeito por isso é so fazer, colar o código e já está.


--------------------
"Think today's world, where Apple is the innovative underdog, Google is the company that does no evil, and Microsoft sits atop its throne as ruler of an evil empire. Will this state of affairs last forever? Apple and Google will also be hated someday..." by Someone

"It's not about ego. Really. If it was ego, I'd be telling you about my awesome... oh, never mind." By Bruce Perens

lycosman @ Twitter

Go to the top of the page
 
+Quote Post
cocacola
post Jun 10 2006, 01:29 PM
Post #11




Grupo: Membro
Posts: 764
Registado: 26-April 06
Membro nº: 1,255



(LycosMan)
(cenourinha)
Tipo, isto é só meter no compilador e F5 ?
Ou precisa de alguma coisa adicional?


Precisas de criar uma picturebox chamada Picture1, um botão chamado Command1 e duas text boxes, uma chamada Text1 e outra Text2. Estes nomes vêm por defeito por isso é so fazer, colar o código e já está.


yah, vais ter que fazer isso
Go to the top of the page
 
+Quote Post
cenourinha
post Jun 10 2006, 01:52 PM
Post #12


Vegetal ambulante
Ícone do grupo

Grupo: Super Administrador
Posts: 10,926
Registado: 26-July 05
De: Barcelos, Portugal
Membro nº: 52



Bem, eu fiz isso tudo e dá-me este erro:



--------------------
God almighty
Go to the top of the page
 
+Quote Post
Kacetada
post Jun 10 2006, 02:31 PM
Post #13




Grupo: Membro
Posts: 210
Registado: 23-February 06
Membro nº: 668



contacta - para o mail e eu digo o k tens de fazer, pk nao sei onde te da erro
Go to the top of the page
 
+Quote Post
lycosman
post Jun 10 2006, 03:41 PM
Post #14



Ícone do grupo

Grupo: Moderador
Posts: 3,762
Registado: 27-July 05
De: Fátima/Leiria
Membro nº: 14



Tenho o VB6 desinstalado e não sei onde anda o DVD se não dizia-te onde esta o problema. Mas a avaliar pela imagem tá relacionado com a Text2 (tá o nome seleccionado no código)... Kacetada, alteraste alguma propriedade da dita textbox? Se sim, diz ai...


--------------------
"Think today's world, where Apple is the innovative underdog, Google is the company that does no evil, and Microsoft sits atop its throne as ruler of an evil empire. Will this state of affairs last forever? Apple and Google will also be hated someday..." by Someone

"It's not about ego. Really. If it was ego, I'd be telling you about my awesome... oh, never mind." By Bruce Perens

lycosman @ Twitter

Go to the top of the page
 
+Quote Post
cocacola
post Jun 10 2006, 03:41 PM
Post #15




Grupo: Membro
Posts: 764
Registado: 26-April 06
Membro nº: 1,255



se calhar não é o text2 mas sim o text1 por exemplo
Go to the top of the page
 
+Quote Post
KhAoTiK_TaChYoN
post Jun 10 2006, 04:33 PM
Post #16



Ícone do grupo

Grupo: Moderador
Posts: 4,283
Registado: 2-January 06
De: Coimbra/Cantanhede
Membro nº: 436



Código identado.


--------------------
QUOTE("Steve Ballmer @ USA Today")
There's no chance that the iPhone is going to get any significant market share. No chance.

Current status: 13.016.000 iPhones sold 'til September 2008.

/target Steve Ballmer
/cheer
Go to the top of the page
 
+Quote Post
SteveCAnthrax
post Mar 13 2008, 01:50 AM
Post #17




Grupo: Membro
Posts: 347
Registado: 16-October 06
De: South Africa
Membro nº: 4,214



(lycosman)
Não testei, mas deve funcionar. Se bem que podia estar mais organizadito... Picture1 e Command1? Um programador dá nomes às coisas, por mais basaroucos que sejam... wink.gif


Por exemplo eu defino todas as minha var e const com nome de raparigas, para o vb é coisa mais ao menos assim dim maria as integer, tatiana as double ...
Go to the top of the page
 
+Quote Post
lycosman
post Mar 13 2008, 11:52 AM
Post #18



Ícone do grupo

Grupo: Moderador
Posts: 3,762
Registado: 27-July 05
De: Fátima/Leiria
Membro nº: 14



(SteveCAnthrax)
(lycosman)
Não testei, mas deve funcionar. Se bem que podia estar mais organizadito... Picture1 e Command1? Um programador dá nomes às coisas, por mais basaroucos que sejam... wink.gif


Por exemplo eu defino todas as minha var e const com nome de raparigas, para o vb é coisa mais ao menos assim dim maria as integer, tatiana as double ...


Não sou capaz. Tenho que olhar para o nome e perceber o que é, o que faz, para que serve e que tipo de dados rebe.


--------------------
"Think today's world, where Apple is the innovative underdog, Google is the company that does no evil, and Microsoft sits atop its throne as ruler of an evil empire. Will this state of affairs last forever? Apple and Google will also be hated someday..." by Someone

"It's not about ego. Really. If it was ego, I'd be telling you about my awesome... oh, never mind." By Bruce Perens

lycosman @ Twitter

Go to the top of the page
 
+Quote Post
morgado0
post Mar 17 2008, 07:33 PM
Post #19




Grupo: Membro
Posts: 131
Registado: 5-February 08
Membro nº: 21,572



n percebi nada sad.gif


--------------------
ajuda hoje e seras ajudado amanha!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

Publicidade
who's online
Versão Simples
Skin by IPB Customize
Horário: 23rd November 2008 - 12:43 AM