• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with my logic  RSS feed

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say I have an array which contains a list of events represented by an integer:

Suppose I also have an array which contains a list of occurences for each event i.e. the number of times an event has to be put on, respectively:

I have been trying to come up with some for / while loop with which to create a new array which will list all of the events required given the data in the arrays. For example:


Anyone got any ideas, as I have exhausted my metal thinking through experimentation on how to do this?

Cheers
[ February 11, 2006: Message edited by: Sam Bluesman ]
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is one way.

 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is another approach.

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to both of you for that. That's a great help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!