LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default random number generation help

Greetings,

I am writing an attack simulator for a game I play. In the game,
combat begins with ships on both sides attacking opposing ships at
random. Part of my program contains a 2 dimensional array where a
random number is assigned for each ship through a series of loops,
if's, select cases, etc...For the random number assignment, I am using
the code line:

ATM(ShipCount, 5) = Int((TotalDefenseShips * Rnd) + 1)

This appears to be working great and is randomly assigning numbers
througout my array, as I want. HOWEVER, I have noticed that the series
is the same with every run of the program. I need to alter my code so
the random number does not follow the same sequence, even if I don't
change any variables. With every run of my simulation, every point in
the array must have a random number assigned to it that was different
than the last simulation run.

Any ideas?

Thanks very much in advance!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Number Generation navel151 Excel Programming 2 October 15th 08 02:31 AM
RANDOM NUMBER GENERATION. HARSHAWARDHAN. S .SHASTRI[_2_] Excel Worksheet Functions 4 September 21st 08 06:01 PM
Help for Random Number Generation krisinvincible Excel Worksheet Functions 3 May 7th 07 12:41 AM
random number generation Ahmad Excel Discussion (Misc queries) 3 November 6th 06 06:27 PM
random number generation scotjo Excel Worksheet Functions 4 January 9th 06 04:06 PM


All times are GMT +1. The time now is 03:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"