Posted: Wed Nov 12, 2003 1:05 pm Post subject: (No subject)
tony- u should look at the OOP in c++, it might not be as "correct" as it is in java but it is really powerful (mutiple inheritance, abstract functions/classes, etc)
Sponsor Sponsor
smith_scott_04
Posted: Wed Nov 12, 2003 6:38 pm Post subject: I Have Already Wrote The Program
Here is the lotto 649 game just change a few variables.
code:
var num : array 1 .. 6 of int
var number : array 1 .. 6 of int
var tot : int := 0
var finish : boolean
procedure RandNum ()
var doesrepeat : boolean
randint (num (1), 1, 49)
for cRandNum : 2 .. 6
loop
doesrepeat := false
randint (num (cRandNum), 1, 49)
for cNewRand : 1 .. cRandNum - 1
if num (cRandNum) = num (cNewRand) then
doesrepeat := true
end if
end for
exit when doesrepeat = false
end loop
end for
end RandNum
locate (9, 2)
put "The Numbers Were: "
locate (10, 2)
color (red)
put num (1), " - " ..
put num (2), " - " ..
put num (3), " - " ..
put num (4), " - " ..
put num (5), " - " ..
put num (6)
tot := tot + 1
loop
var doesrepeat : boolean := false
loop
locate (3, 1)
color (255)
put "Choose 6 Numbers (1,49): " ..
drawfillbox (200, 350, 400, 370, white)
get number (tot)
doesrepeat := false
if tot > 1 then
for c1 : 1 .. tot - 1
if number (c1) = number (tot) then
doesrepeat := true
end if
end for
else
exit
end if
exit when doesrepeat = false
end loop
if number (tot) <= 49 then
if tot < 6 then
locate (5, locate1)
put number (tot), " - "
end if
if tot > 5 then
locate (5, locate1)
put number (tot)
end if
exit
end if
end loop
locate (1, 28)
color (blue)
put "Lotto 649 - Just Imagine"
color (255)
RandNum
Guess
CheckNums
ShowNum
delay (10000)
cls
tot := 0
end loop
Chimaera
Posted: Wed Nov 12, 2003 7:34 pm Post subject: (No subject)
you can't exit your program without doing it manually. Perhaps you should modify your program to do so, but other than that nice program. It doesn't have much to do with Super 7 though.
Tony
Posted: Wed Nov 12, 2003 11:52 pm Post subject: (No subject)
blade - obviously mine is simpler AND has better execution time... has less lines of code too