Computer Science Canada lotto 649 |
Author: | GUI.GetScrollBarWidth : i [ Wed Feb 18, 2004 12:04 pm ] |
Post subject: | lotto 649 |
var num1, num2, num3, num4, num5, num6, numm1, numm2, numm3, numm4, numm5, numm6 : int var c1, c2, c3, c4, c5, c6 : int := 0 cls put "play lotto649." put "the 649 is how many millions of $ we steal" loop randint (num1, 1, 49) randint (num2, 1, 49) randint (num3, 1, 49) randint (num4, 1, 49) randint (num5, 1, 49) randint (num6, 1, 49) if num1 not= num2 and num1 not= num3 and num1 not= num4 and num1 not= num5 and num1 not= num6 and num2 not= num3 and num2 not= num4 and num2 not= num5 and num2 not= num6 and num3 not= num4 and num3 not= num5 and num3 not= num6 and num4 not= num5 and num4 not= num6 and num5 not= num6 then exit end if end loop put "enter your first number" get numm1 put "enter your second number" get numm2 put "enter your third number" get numm3 put "enter your fourth number" get numm4 put "enter your fifth number" get numm5 put "enter your sixth number" get numm6 cls cls put "the winning numbers are:" put " ", num1, " ", num2, " ", num3, " ", num4, " ", num5, " ", num6 put "" put "your numbers are" put " ", numm1, " ", numm2, " ", numm3, " ", numm4, " ", numm5, " ", numm6 var pic := Pic.FileNew ("lotto pic3.bmp") Pic.Draw (pic, 0, 50, picCopy) if num1 = numm1 then put "you got the first number right" else put "you got the first number wrong" if num2 = numm2 then put "you got the second number right" else put "you got the second number wrong" if num3 = numm3 then put "you got the third number right" else put "you got the third number wrong" if num4 = numm4 then put "you got the foruth number right" else put "you got the foruth number wrong" if num5 = numm5 then put "you got the fifth number right" else put "you got the fifth number wrong" if num6 = numm6 then put "you got the sixith number right" else put "you got the sixith number wrong" end if end if end if end if end if end if i'm bord so i posted this, imade it for school |
Author: | Paul [ Wed Feb 18, 2004 8:59 pm ] |
Post subject: | |
Keep trying lucas, good start, here's some bits so you wouldn't say "Gymasium" anymore. |
Author: | Scorne [ Mon Jun 28, 2004 11:06 pm ] |
Post subject: | Randomizing numbers for whatever reason. |
I did this stuff 4 years ago and forget how.. How would i make a program to Randomize (3,6,12,24) numbers(1 set) from like (X amount) sets of 12 numbers.. So i input x (120, 60, etc numbers).. to create (3,6,12,24) numbers Catch my drift..? Just to make sure its all smooth.. ------ "How many Numbers do you want Randomized?" (3,6,12,24) "How many Sets of (3,6,12,24) will be randomized?" (3,6,12,24) "Please input the first (3,6,12,24) digits" 768645 " " " " "Please input the last (3,6,12,24) digits" 877678 "From those numbers " 999999 was generated |
Author: | Tony [ Tue Jun 29, 2004 12:12 am ] |
Post subject: | |
wow, I'm lost... your problem doesnt seem to make any sence... and how does it have anything to do with a lottery game? |
Author: | Cervantes [ Tue Jun 29, 2004 9:42 am ] | ||
Post subject: | |||
umm, "lucas", if that's your name: your if statements at the end are all wrong. here's why: starting at line 51: if the number you picked equals the first number of the lottery then put "you got the first number right" and skip the entire else section and continue the program at end if. so even if you got all 5 of the other numbers right, the program still won't output that you got them right if you got the first number right. you could fix this by doing something like this:
|
Author: | the_short1 [ Tue Jun 29, 2004 3:25 pm ] |
Post subject: | |
also the arrays are very useful in this... <cervants just added them rite? but other then that.... i like ur program... nice ... simple.. and to the point.. some suggestions: (just suggestions) -Add a ball tumbler animation -Add GUI Buttons <since thats in ur name -Maybe add a GUI keypay to enter the numbers (pm me if u want the source code) -add some color... |
Author: | Paul [ Tue Jun 29, 2004 3:48 pm ] |
Post subject: | |
yea... look at the date on that thing... plus I know that he's prolly not coming back to compsci again and not programming again. |