dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: JavaScript code for a draft simulation involving 1 user and 11 automated bidders

  1. #1
    Join Date
    Feb 2012
    Posts
    15

    JavaScript code for a draft simulation involving 1 user and 11 automated bidders

    So I have 12 employees about ready to place bids on projects at work... and we will be drawing names out of a hat, 1-12.

    What I am looking for is code to construct a simulator that will help the user run through scenarios of bidding on projects at work.

    For example, everyone will draw a name out of a hat (numbers 1-12). The first person gets to call dibs on the first work project of choice (let's say the most fun)... this will not be the tool used to actually select or submit request, I merely want a "simulator" everyone can use (via javascript) so that all 12 people can simulate what "projects" will be available at certain bidding slots... So when this tool is used, it's basically the person using the simulation vs. 11 other "automated" bidders... and those automated slots will just bid off of a list (that I can manage and reorder via values I have based on popularity)....

    So, the definitions for the code:

    1. So the user, who will be bidding by himself against automated bidders, will select their bid slot (1-12) at the very beginning, to prepare for whatever pick they eventually get out of the hat.
    2. Whatever pick or slot the user selects, they will have the opposite pick in the following round, but then back to their original slotting in the 3rd, then the opposite in the 4th again, and so on, so a snake-like bidding pattern. So ex: a person selects to bid from the 1st spot would have slots: 1, 24, 25, 36, 48, 49, etc..
    3. When the user is up (ex: they pick the 1st slot, they are up right away), the user will have a drop down list of all available jobs (not yet selected), then they will have a "select" button they can hit that will insert their selection into the running bid list
    4. After the user hits select, all automated bid slots will be instantly filled in (using the running list in order that the running list is constructed (that I could change whenever, like if we kill a project and create a new one)... so essentially, the user is always "on the spot" to make their bid, cause auto picks will instantly fill in up to the point that the user is up again right away.
    5. For automated bidders will immediately fill in using the running list as the source to select and in what order... as projects are selected, these projects vanish from the drop down list to select from
    6. So, essentially, each time the user of this tool selects the project (When their bid is up), they are immediately back up and ready to bid again because those auto picks are, well, auto and immediate.

    Example of first piece:

    1. What bid slot do you want to simulate from? [ select 1-12 ]

    After selection is selected, let's say #4 bid slot is selected:

    2. A draft list will start developing and read something like:

    1.01 - Green Initiative Project - Auto bidder
    1.02 - Thomas Murphy, Jr. Project - Auto bidder
    1.03 - Awaika Project - Auto bidder
    1.04 - YOU ARE UP! BID!
    >> Drop down list [80 projects inside drop down, minus the three above which are gone ] [select button ]

    3. Once the user selects the 4th project, the running draft list will continue to generate the running draft results, and the user will immediately be back up to make their next bid, so after the select button is pressed, it would look like (immediately):

    1.01 - Green Initiative Project - Auto bidder
    1.02 - Thomas Murphy, Jr. Project - Auto bidder
    1.03 - Awaika Project - Auto bidder
    1.04 - Willow Project - (This is you!!!)
    1.05 - d project - Auto bidder
    1.06 - e project - Auto bidder
    1.07 - f project - Auto bidder
    1.08 - g project - Auto bidder
    1.09 - h project - Auto bidder
    1.10 - i project - Auto bidder
    1.11 - j project - Auto bidder
    1.12 - k project - Auto bidder
    2.01 - l Project - Auto bidder
    2.02 - m Project - Auto bidder
    2.03 - n - Auto bidder
    2.04 - o Project - (This is you!!!)
    2.05 - p project - Auto bidder
    2.06 - q project - Auto bidder
    2.07 - r project - Auto bidder
    2.08 - s project - Auto bidder
    1.09 - YOU ARE UP! BID!
    >> Drop down list [63 projects inside drop down, minus the 20 above which are gone ] [select button ]

    For the third round of bidding, the user in this situation would pick at 3.04 (odd rounds are the same slot, and then at 4.09 (even rounds are the same)...

    And so on...

    The drop down list (Which the auto picks would just select from down the line) would again be powered by a master list I could update, and that would look something like:

    Green Initiative Project
    Thomas Murphy, Jr. Project
    Awaika Project
    d project
    e project
    f project
    g project
    h project
    i project
    j project
    k project
    l project
    m project
    n project
    o project
    p project
    q project
    r project
    s project
    t project
    u project
    v project

    * all automated bidders would select the top project first, only the user could deviate from the drop down and alter the order... and again, each time a project gets selected, it is removed from the drop down list, but stays in order of what I rank the projects on the master list...

    I know this is a A LOT to process, and I'm so sorry for the length of this..

    Anyone's help is MUCH appreciated.

    Thank you, and I look forward to anyone's help!!!!!
    Last edited by billybobt; 02-15-2012 at 01:11 AM.

  2. #2
    Join Date
    Nov 2010
    Posts
    1,097
    hello again Bob,

    the way I understand it, I'm not entirely sure that javascript is the best language for this. You understand that every time the page is refreshed the "list" will go back to as it was in the beginning, and even that if two users are looking at the page from different locations each will be presented with a separate list and have no idea what is going on with the "master" list or what the other user has done.

    basically, for it to work, all the users will have to sit down at one time, fill out the entire list in one go and then the list will have to be saved elsewhere.

    javascript can be made to interact with a database, but if you're going to be doing that from the start, you might consider a server-side language to do the heavy lifting, with javascript doing what it is supposed to do - facilitate user interactions with a single page.

  3. #3
    Join Date
    Feb 2012
    Posts
    15
    Ok, php? Thanks in advance!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles