[source] Super7 Quick Pick Machine Simulator v1.0
Author |
Message |
we64

|
Posted: Tue Jan 27, 2004 11:22 pm Post subject: [source] Super7 Quick Pick Machine Simulator v1.0 |
|
|
I just got started on this... so it is not finished, only the most basic part are done, well I will keep updating new versions.
code: |
%Super7 Quick Pick Machine Simulator v1.0
%By Tony Zhang
var number : array 1 .. 7 of int
var numbstr : array 1 .. 7 of string
var random1, random2, randc, counter : int := 0
%Getting Numbers
for a : 1 .. 7
randint (random1, 01, 23)
randint (random2, 24, 47)
randint (randc, 1, 2)
if randc = 1 then
number (a) := random1
elsif randc = 2 then
number (a) := random2
end if
end for
%Same Number Checking
for a : 1 .. 7
for b : 1 .. 7
if b = a then
number (a) := number (a)
elsif number (a) = number (b) then
randint (randc, 01, 47)
number (a) := randc
end if
end for
end for
%Sort Numbers
for a : 1 .. 7
for b : 1 .. 7
if number (a) < number (b) then
counter := number (a)
number (a) := number (b)
number (b) := counter
end if
end for
end for
%Outputs
for a : 1 .. 7
if number (a) < 10 then
numbstr (a) := "0" + intstr (number (a))
else
numbstr (a) := intstr (number (a))
end if
put numbstr (a), "" : 2 ..
end for
|
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Paul

|
Posted: Tue Jan 27, 2004 11:25 pm Post subject: (No subject) |
|
|
Hey, it would be cool if you actually simulated as a real live picking device, like the machine with the ball? you could make the number balls roll in or something... |
|
|
|
|
 |
we64

|
Posted: Tue Jan 27, 2004 11:30 pm Post subject: (No subject) |
|
|
that is a pretty good idea, I will give it a try.  |
|
|
|
|
 |
shorthair

|
Posted: Wed Jan 28, 2004 8:02 am Post subject: (No subject) |
|
|
Tht will be a good chalenge for a newer programmer ( not meaing to flame if you are not ), good luck with it id be real impressed to see it |
|
|
|
|
 |
shorthair

|
Posted: Thu Jan 29, 2004 12:06 pm Post subject: (No subject) |
|
|
Any luck on working on an update for this program , if you need help jsut ask , id quite like ot be a part of this |
|
|
|
|
 |
TheXploder

|
Posted: Thu Jan 29, 2004 12:27 pm Post subject: (No subject) |
|
|
Hey, good Job... yeah I would also like to see the proccess of the the ball selection...  |
|
|
|
|
 |
Paul

|
Posted: Thu Jan 29, 2004 12:31 pm Post subject: (No subject) |
|
|
Oh oh! sound effects too! like a popping noise... |
|
|
|
|
 |
we64

|
Posted: Thu Jan 29, 2004 6:04 pm Post subject: (No subject) |
|
|
thank you for your supports, I am giving it my best shot, I will post my program as it goes. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
we64

|
Posted: Thu Jan 29, 2004 10:31 pm Post subject: (No subject) |
|
|
This is what I have so far... I don't know how to make the ball bounce around in the circle, so I just random the postion of the ball. Anybody got ideas of how to make the ball bounce.
code: |
%Lottory Machine
var x, y, font1, font2 : int := 0
var numbers : array 1 .. 47 of int
setscreen ("graphics:1000;650")
font1 := Font.New ("serif:24:bold")
font2 := Font.New ("serif:12:bold")
%Title
Draw.Text ("Super7 Lottory Machine", maxx div 2 - 165, maxy - 30, font1, red)
%Give value for 47 numbers array
for n : 1 .. 47
numbers (n) := n
end for
%Balls
proc ball1
drawfilloval (350 + x, 250 + y, 5, 5, 87)
delay (100)
drawfilloval (350 + x, 250 + y, 5, 5, 56)
end ball1
%Basic Machine Parts
drawfilloval (maxx div 2, maxy div 2 + 100, 180, 180, 56)
drawfillbox (maxx div 2 - 20, maxy div 2 - 80, maxx div 2 + 20, maxy div 2 - 175, 8)
drawfillbox (maxx div 2 - 190, maxy div 2 - 165, maxx div 2 + 20, maxy div 2 - 205, 8)
%Outputs
loop
randint (x, 35, 250)
randint (y, 35, 300)
ball1
end loop |
|
|
|
|
|
 |
Paul

|
Posted: Thu Jan 29, 2004 10:35 pm Post subject: (No subject) |
|
|
Thats great dude, This might help you
http://www.compsci.ca/v2/viewtopic.php?t=2779&highlight=bounce
though Im not sure about bouncing in a circle, weren't some 1 else having trouble with that?
It would be cool if you made a bunch of them bounce in a case, then eject them one by one into a transparant channel. |
|
|
|
|
 |
|
|