User Control Panel
Search iVirtua
Advanced/Tag Search...
Search Users...
What is iVirtua Exclusive Community?
  • An exclusive gaming industry community targeted to, and designed for Professionals, Businesses and Students in the sectors and industries of Gaming, New Media and the Web, all closely related with it's Business and Industry.
  • A Rich content driven service including articles, contributed discussion, news, reviews, networking, downloads, and debate.
  • We strive to cater for cultural influencers, technology decision makers, early adopters and business leaders in the gaming industry.
  • A medium to share your or contribute your ideas, experiences, questions and point of view or network with other colleagues here at iVirtua Community.
Guest's Communication
Live Chat
Teamspeak (VOIP) Audio Conference
Private Messages
Check your Private Messages
Themes
Choose an iVirtua Community theme to reflect your interests...
Business Theme
India/Arabic Theme

Gaming Theme
iVirtua Recommends
Fly Emirates Advertising
lotto problem
Digg This Digg Topic Tag it on del.icio.us Tag topic on On del.icio.us Technorati Search Technorati Search Post to Slashdot Post to Slashdot
You are currently in Programming, Web and Software Design/Development
Post new topic Reply to topic
Mon Sep 25, 2006 10:12 am Reply and quote this post
since i requested this section , i'll do the first post i needed to make some sort of lottery program but since its still the beginning of the year we dont need to add any extra surveilance to make sure the same number can't be shown twice (randomize function) but i want to do this security thingy so can anyone tell me here is my listing

Option Explicit
Dim intgetal1 As Integer
Dim intgetal2 As Integer
Dim intgetal3 As Integer
Dim intgetal4 As Integer
Dim intgetal5 As Integer
Dim intgetal6 As Integer

Private Sub cmdlotto_Click()
Randomize (42)

intgetal1 = (Rnd * 42) + 1
intgetal2 = (Rnd * 42) + 1
intgetal3 = (Rnd * 42) + 1
intgetal4 = (Rnd * 42) + 1
intgetal5 = (Rnd * 42) + 1
intgetal6 = (Rnd * 42) + 1

txtlotto.Text = Val(intgetal1) & ", " & Val(intgetal2) & ", " & Val(intgetal3) & ", " & Val(intgetal4) & ", " & Val(intgetal5) & ", " & Val(intgetal6)

Contributed by dreadful, iVirtua Ultimate Contributor
110 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Tue Sep 26, 2006 12:44 pm Reply and quote this post
for the information: this is visual basic (i think)
Contributed by Pyr0, iVirtua Active Contributor
100 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Tue Sep 26, 2006 1:00 pm Reply and quote this post
yea i forgot to mention i program ALL my stuff in VB
Contributed by dreadful, iVirtua Ultimate Contributor
110 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Tue Sep 26, 2006 3:04 pm Reply and quote this post
where do you go to school?

first of all your random isn't that good its vb style and not vb.net style!
dim RandomGetal as new random
intGetal1 = RandomGetal.next(1,42)


for the numbers you can work with an array but I think you don't work with them yet

for security you can use a nested if or a select case or a do-loop!

I'll explain do loop

intGetal1 = randomGetal.next(1,42)
do
intGetal2 = randomGetal.next(1,42)
loop until intGetal2 = Not intGetal1
do
intGetal3 = randomGetal.next(1,42)
loop until intGetal3 = Not intGetal1 and intGetal3 = Not intGetal2
do
intGetal4 = randomGetal.next(1,42)
loop until intGetal4 = Not intGetal1 and intGetal4 = Not intGetal2 and intGetal4 = Not intGetal3

......



if you need to ask some more about anything else in vb.net just ask

Contributed by GuruMadMat, iVirtua Members
100 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Wed Sep 27, 2006 8:31 am Reply and quote this post
we work in vb6 and not .net
and i go to school in sithi@

Contributed by dreadful, iVirtua Ultimate Contributor
110 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Wed Oct 25, 2006 11:51 am Reply and quote this post
You can make it much smaller without the security

Code:
Sub Lottery
Dim intCount As Integer
Dim strOutput As String
strOutput = "" 'To make sure that strOutput is empty
For intCount = 1 to 6
    strOutput = strOutput & (Rnd * 42) + 1
Next 'intCount
MsgBox strOutput
End Sub 'Lottery

Contributed by Seradon, iVirtua Participating Member
100 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Wed Oct 25, 2006 12:58 pm Reply and quote this post
("GuruMadMat":2su9zji6)
where do you go to school?

first of all your random isn't that good its vb style and not vb.net style!
dim RandomGetal as new random
intGetal1 = RandomGetal.next(1,42)


for the numbers you can work with an array but I think you don't work with them yet

for security you can use a nested if or a select case or a do-loop!

I'll explain do loop

intGetal1 = randomGetal.next(1,42)
do
intGetal2 = randomGetal.next(1,42)
loop until intGetal2 = Not intGetal1
do
intGetal3 = randomGetal.next(1,42)
loop until intGetal3 = Not intGetal1 and intGetal3 = Not intGetal2
do
intGetal4 = randomGetal.next(1,42)
loop until intGetal4 = Not intGetal1 and intGetal4 = Not intGetal2 and intGetal4 = Not intGetal3

......



if you need to ask some more about anything else in vb.net just ask

showoff

Contributed by jello, iVirtua Ultimate Contributor
100 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Thu Oct 26, 2006 9:45 am Reply and quote this post
nvm i already solved it , and the teacher said it was good, i just just 1 intgetal and make it loop for 6 times
so u get 6 numbers and then i put a controle to see the number couldnt be a double
i'm not at school so i cant show the code lol

Contributed by dreadful, iVirtua Ultimate Contributor
110 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Mon Dec 11, 2006 6:09 pm Reply and quote this post
c# rules vb
Contributed by me, iVirtua Members
100 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Sat Apr 14, 2007 1:59 am Reply and quote this post
intgetal1 = (Rnd * 42) + 1
intgetal2 = (Rnd * 42) + 1
intgetal3 = (Rnd * 42) + 1
intgetal4 = (Rnd * 42) + 1
intgetal5 = (Rnd * 42) + 1
intgetal6 = (Rnd * 42) + 1

That can be shortened to...

dim i, intget(6) as integer

for i = 1 to 6
inget(i) = (Rnd * 42) +1
next i

Contributed by Lococard, iVirtua Recognised Member
100 iVirtua Loyalty Points • View ProfileSend Private MessageBack to Top

Related Articles
Post new topic   Reply to topic


Page 1 of 1

iVirtua Latest
Latest Discussion

Discuss...
Latest Articles and Reviews

Latest Downloads
Subscribe to the iVirtua Community RSS Feed
Use RSS and get automatically notified of new content and contributions on the iVirtua Community.


Tag Cloud
access amd announced applications author based beta building business card case company content cool core course cpu create data deal dec demo design desktop developers development digital download drive email feature features file files firefox flash free future gaming google graphics hardware help industry information intel internet iphone ipod jan launch linux lol love mac market media memory million mobile money movie music net nintendo nov nvidia oct office official online patch performance playing power price product program ps3 pst publish ram release released report rss sales screen search security sep server show size software sony source speed support technology thu tue update video vista war web website wii windows work working works xbox 360 2006 2007 2008

© 2006 - 2008 iVirtua Community (UK), Part of iVirtua Media Group, London (UK). Tel: 020 8144 7222

Terms of Service and Community RulesAdvertise or Affiliate with iVirtuaRSSPress Information and Media CoverageiVirtua Version 4PrivacyContact