Select Colors Randomly and assign them to dates


  • Good Morning,

    In this little project that I have, I need to assign colors from an array of 6 or 7 colors and have them show up in a website depending on the date of the month.

    I am brand new at C# and I am not asking for code (not the full solution at least) basically my idea is that I have an array of 7 colors (Yellow,Green,Red,Purple,Brown,Orange and maybe Grey) and each color has to show up (in a textbox on a website) randomly depending on the frequency of each color. (Yellow=13X/month,Green=9X/month,Purple=5X/month, Brown=3X/month, Orange= 1X/month, Grey=1X/ every other month)

    What we do right now, is that we look at the calendar and start writing in the colors, then with a simple interface that I built, we enter the colors from a text box every day. I want to be able to pick the colors automatically every month and assign them to the days so that when the individual logs in he can see that it is his day and has to call us to get drug tested.

    Please, point me out to the right direction, right now I need to know where to start. I am reading about arrays and randomizing numbers from the array but  I have no idea how to 'assign it' to the day of the month.  (Maybe turn each day of the month into an object and then run the randomizing method, the array will have all the colors until and deduct 1 from the frequency each time it gets picked, when it reaches 0, then that color is not eligible anymore until we run out of colors and days in the month)

    Any help will be appreciated, thank you!

    Tuesday, October 05, 2010 6:09 PM


All replies