Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crazy question: Can anyone help me create a routine to roll 2 dice 1000x and sum them? 4

TheresAlwaysAWay

Programmer
Mar 15, 2016
145
US
I'm fooling with a game program idea in Access that requires rolling of dice 1000x and summing the two of them, roughly equivalent to 1000 rolls on a craps table.

I used the Rnd function successfully, but it doesn't run hands sequentially to store them in a table for future reference.

I'm hoping one of the wizards out there can come up with something that will do the trick relatively quickly.

As always, thanks in advance to all of you.
 
Problem solved, so it's just an idea to complete the task with queries only:

1. create a table [T10] with field [V], values 1 to 10,
2. query:
SELECT
100*[T10_2].[V]+10*[T10_1].[V]+[T10].[V]+1 AS ID, Int(Rnd(2*[ID]-1+Timer())*6)+1 AS Dice1, Int(Rnd(2*[ID]+Timer())*6)+1 AS Dice2
FROM T10, T10 AS T10_1, T10 AS T10_2;

May store calculated results if converted to INSERT INTO query.
 
>a calculated field

We are talking at crosspurposes here, I think; you are talking about calculating a field in a query. I was talking about a calculated field in a table. Calculations in queries are fine. and inevitable ...
 
I am curious about any drawbacks of calculated field(s) in a table. 🤔
 

Part and Inventory Search

Sponsor

Back
Top