Jump to content
Sign in to follow this  
hartmut

10 random numbers 1-80

Recommended Posts

hartmut    0

HI - I would like to find a formula that would generate random numbers (10 ) of the 1-80 like

7 19 10 27 38 39 40 30 58 80

Is this possible to do in filemaker?

Thanks

Share this post


Link to post
Share on other sites
LaRetta    482

This may give you what you want ... [color:blue]Ceiling ( Random * 80 )

Script would fire 10 times by User (or loop or) - You haven't explained how it'll be used yet. But, what if you were given random duplicates? That, I would think, would be legal. If not, you could prevent it as well by rejecting the entry and 'rolling the dice' again. I would need to know whether the results reside in repetitions, records, variables etc.

Share this post


Link to post
Share on other sites
hartmut    0

Thanks very much. It works great.

I am trying to make a superball keno game. There are 80 green squared numbered 1-80 . The user picts 10 numbers and 20 numbers are turned red - if the user chooses any of those random numbers he/she has those numbers counted and turned red. if they are not his numbers they turn purple. If the last number generated is one of those he/she chose he gets 4 times the value of that selection. I just want to work on this for fun in this room. It should take a while to do this. It is fun to play and it is interesting to learn how to make it.

I am guessing if there are 80 boxes I would start with 80 fields.

So the first problem is to make the 80 boxes change color when the random number is generated when it is one of theirs selected.

Lets get that started here

Thanks

Dave

Thanks

Dave

Edited by Guest

Share this post


Link to post
Share on other sites
comment    1,392

I am guessing if there are 80 boxes I would start with 80 fields.

I'm not familiar with this game, but I am guessing if there are 80 boxes I would start with 80 RECORDS.

Share this post


Link to post
Share on other sites
hartmut    0

Not sure

I have encountered my first problem. If the game generates 20 numbers, which it does - How do I calculate the following?

If this is a sample number generation below:

72 56 70 40 27 4 10 23 75 17 30 46 6 47 12 15 51 49 28 22

What would be the calculation to determine if the number "4" is part of that string of numbers? ( in this case it is the 6th word in the string and it is there. )

Ps. I am doing this because then I can change the color of the text in the box if , in this case, the number"4" is part of the random string.

Edited by Guest

Share this post


Link to post
Share on other sites
comment    1,392

I didn't realize this game was so primitive. Basically, all you need are two text fields: Ticket and Draw. The user-picked numbers go into Ticket, separated by a carriage return (you can use a checkbox with a value list of numbers from 1 to 80). The random-generated numbers go into Draw - again, separated by a carriage return.

The winning numbers are:

FilterValues ( Ticket ; Draw )

and the score is:

ValueCount ( FilterValues ( Ticket ; Draw ) )

That's it for the mechanics of the game. You could add a repeating calculation field with 80 repetitions for the display.

Share this post


Link to post
Share on other sites
hartmut    0

I have enclosed an actual half screen of superball keno.

I have labeled what each thing does.

I am trying to reconstruct this in Filemaker as a challenge.

I am going for this look.

My next question is:

If this is a sample number generation below:

72 56 70 40 27 4 10 23 75 17 30 46 6 47 12 15 51 49 28 22

What would be the calculation to determine if the number "4" is part of that string of numbers? ( in this case it is the 6th word in the string and it is there. )

When I get this done I will post what I have. So everyone can see the progress.

Thanks

Dave

superballkeno.jpg

Share this post


Link to post
Share on other sites
comment    1,392

What would be the calculation to determine if the number "4" is part of that string of numbers?

If you'll read more carefully, you'll see I have already answered this question.

Share this post


Link to post
Share on other sites
hartmut    0

I can see you have but I am concerned the way the buttons ( fields) would have to change colors, and how they are named and eventually need to have the number counted that are won, and selected. I wasn't sure if this could happen. That is why I put the jpg up so you could see what I am going for. ,

For example, I would have to write some kind of script to make the box or square change to yellow right off the bat when the user selects that square. Also with the repeating fields I have a problem understanding how i can make this configuration of squares,

1 2 3 4 5 6 7 8 9 10

111213141516171819 20

21222324252627 282930

31323334353637 38 3940

41424344454647 48 4950

5152535455565758 59 60

61626364656667 68 6970

71727374757677 78 79 80

I ultimately want the random generated numbers to change

the color of the boxes they are in to purple if the user hasn't selected them or red for those numbers out of the random numbers that the user has selected.

The user can also only select 10, 9,8,7,6,5,4,3,2 number of numbers - they are not allowed to play more than ten numbers on each play.

Edited by Guest

Share this post


Link to post
Share on other sites
comment    1,392

I think you are making a mistake by considering the looks while constructing the game. The game itself needs only the elements I have listed. Once you have that, you can play with the design to no end. That could be done by conditional formatting or calculations - but it would always reflect the underlying result, not play an actual part in it.

Repeating fields can be split into groups or individual repetitions, so one way to achieve your configuration is to put 7 instances of the field on the layout, each having 10 horizontal repetitions, starting at 1, 11, 21, etc. respectively.

Share this post


Link to post
Share on other sites
hartmut    0

Thank you. I agree with you. I will try to do that. But I am a novice and I didn't know whether i should consider all before I got too far. Thats why I mentioned all those areas.

I will try to make a sample file now as your saying. I am not quite understanding but I will start that now.

thanks

Dave

Share this post


Link to post
Share on other sites
hartmut    0

Hi

I started the file three ways

The 20 numbers randomly generate

I have the check boxes 1-80 in green for Ticket

I have the check boxes 1-80 in yellow for draw

I don't know how to arrange those like i have in my dark green

example.

my dark green example is with 10 repetitions

There i have the problem of how to I change the background

color of the field without changing the whole row.

In my final example I made 10 sample fields (of the 80)

if I imagine that the random numbers generated were something like

33 23 75 18 80 72 43 66 2 1 22 67 57 53 68 37 78 41 7 45

Then i would like a formula to change the background of the fields where 1 and 2 are to purple. Since they were randomly generated by filemaker. Seven was too but it is red because I

chose that number .So one of my numbers came in on the play.

4 was another number I chose in the play but it was not generated by the random number.

Although the last example is only one row. That is what I need to happen in this game

1/The generated numbers have to populate the fields with purple unless the user selected one of those numbers out of his 10 .

2/If one of his user selected (yellow ) numbers come in they would need to turn red.

I have enclosed the file so anyone might be able to play with it.

As I am doing it I can see that it might be possible to use 80 little container fields as the easiest way to change the boxes to different colors. Just a thought

ticket_and_draw.fp7.zip

Edited by Guest

Share this post


Link to post
Share on other sites
sbg2    0

Hi Hartmut,

Comment really gave you the guts of the game which simply two fields that are compared to see what numbers match. You only need 1 repeating field with 80 reps.

Attached is my stab at how you might begin this. Hope it helps and i really enjoyed the little challenge (for me at least).

There are 4 different layouts for the game in order to get around filemakers limitation with hiding buttons. It is also on a smaller scale (4 numbers can be chosen out of 20 and 8 are hard coded for the Random Number).

Keno.zip

Share this post


Link to post
Share on other sites
hartmut    0

Thank you.

I am going to get to work understanding it.

I have to figure all of this out. I think it is fun to do things like this with filemaker. So much appreciated

Dave

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.