Windows Forums
http://forum.mintywhite.com/

How the Giveaway Competitions Work
http://forum.mintywhite.com/viewtopic.php?f=19&t=377
Page 1 of 1

Author:  Rich [ Wed Oct 22, 2008 4:29 am ]
Post subject:  How the Giveaway Competitions Work

It's simple, just follow these easy steps:

1. Register or Login to your Windows Forums account
2. Follow the instructions on the competition details page
3. All members who fulfilled the criteria are automatically entered to win a prize

Competition dates are listed and the winner will be announced on the date set in the competition post. The winner will need to reply to the same post to confirm that he or she is the winner.

Be sure to make a legitimate response to the competition. No cussing, racist, or negative comments. You can submit multiple responses but it will not increase your chance of winning.

The winner(s) will be notified via email, his or her username will be announced on this page and the prize will be sent to you asap.

View current competitions here.


How 'random' is This Random Drawing?

To ensure complete fairness in my competitions, I have written a small script in Java that randomly generates a number which corresponds to the post numbers of the replies to the competition thread. If someone answered twice--when multiple replies aren't counted--only their first post number is added to the random list.

For those of you who are interested, my code is below.

private static Random rd = null;

    public static int[] random(int[] src) {
        if (src == null) {
            return null;
        }

        rd = new Random();
        int[] tmp = new int[src.length];

        int num = src.length;


        int index;

        for (int i = 0; i < src.length; i++) {

            index = Math.abs(rd.nextInt()) % num;
            tmp[i] = src[index];
            src[index] = src[num - 1];
            num--;
        }
        return tmp;
    }

    public static void main(String[] args) {
        int[] test = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
        18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
        int a[] = random(test);

        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
    }

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/