Problem Randomise images no repeats

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

31 Replies - 1447 Views - Last Post: 08 February 2012 - 04:18 PM Rate Topic: -----

Topic Sponsor:

#31 ricardosms  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 65
  • View blog
  • Posts: 267
  • Joined: 02-April 10

Re: Problem Randomise images no repeats

Posted 07 February 2012 - 02:50 AM

Hello Again:
Just to give a couple of head-ons.
1. Keep the files in a directory .
2.Create an arraylist.
3. Do a directory Scan and load filenames to Arraylist.
4. Sort Arraylist(Not Critical).
Arraylist.Sort()


5.Generate a randow number from 0 to 99. Use it as an index for the items on the arraylist.
6. Load the image with that index to a picturebox and save the file name.
7. Rremove item from the arraylist
Arraylist.RemoveAt(index)


7. Reduce the random number limit.
Repeat steps 5 to 7 until you have your 5 images.
8. Display images and start timer.
9. At button.click (Five Buttons) append a line a CSV whith the information and reset timer.
Repeat if needed.
These two links will direct you to a couple of programs I did post.
On the addition Puzzle Game you coud check how I use random without repeats. Not needed, but another way if you would like to check.
On the other one you could see the "scan folder" and "remove this frame" routines. The programs purposes are completelly different than your , but have solved similar situations.

http://www.dreaminco...__fromsearch__1

http://www.dreaminco...__fromsearch__1

I hope this helps you somehow.
Was This Post Helpful? 1
  • +
  • -

#32 Ailaz  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 82
  • Joined: 10-December 11

Re: Problem Randomise images no repeats

Posted 08 February 2012 - 04:18 PM

View Postricardosms, on 07 February 2012 - 09:50 AM, said:

Hello Again:
Just to give a couple of head-ons.
1. Keep the files in a directory .
2.Create an arraylist.
3. Do a directory Scan and load filenames to Arraylist.
4. Sort Arraylist(Not Critical).
Arraylist.Sort()


5.Generate a randow number from 0 to 99. Use it as an index for the items on the arraylist.
6. Load the image with that index to a picturebox and save the file name.
7. Rremove item from the arraylist
Arraylist.RemoveAt(index)


7. Reduce the random number limit.
Repeat steps 5 to 7 until you have your 5 images.
8. Display images and start timer.
9. At button.click (Five Buttons) append a line a CSV whith the information and reset timer.
Repeat if needed.
These two links will direct you to a couple of programs I did post.
On the addition Puzzle Game you coud check how I use random without repeats. Not needed, but another way if you would like to check.
On the other one you could see the "scan folder" and "remove this frame" routines. The programs purposes are completelly different than your , but have solved similar situations.

http://www.dreaminco...__fromsearch__1

http://www.dreaminco...__fromsearch__1

I hope this helps you somehow.

Thank you...I did get there in the end....a few more tweaks to go...
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3