Thread: Contest - Traveller's Dilemma

  1. #31
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    For those of you that have submitted an entry, you might want to check yourself against the judging code. It's sad to see promising entries fail to stay within the bounds. Make sure that your code accounts for variances in the bounds and bonus. I played with the idea of introducing negative integers in some of those arguments, but I figured I'd stick with non-negative integers since it made more sense with the storyline. In short, don't worry about negative integers for the bounds or the bonus; it's all non-negative integers only.

    Need some extra players? I used the following class:
    Code:
    template <int constant>
    class Constant : public Contest::TravellersDilemma
    {
    	int ChooseNumber(int previousEarning, int lowerBound,
    		int upperBound, int bonus)
    	{
    		return constant;
    	}
    };
    To aid in using the judging code, here's a snippet:
    Code:
    //Seed up the rng
    std::srand(std::time(0));
    
    std::vector<std::pair<Contest::TravellersDilemma*, int> > players;
    //push_back all the players with a 0
    //i.e. players.push_back(std::make_pair(new Constant<2>(), 0));
    
    std::vector<std::ostream*> streams;
    //If you want some output to the console.
    streams.push_back(&std::cout);
    //Personally, I find this much more useful.
    streams.push_back(new std::ofstream("simulation.txt"));
    
    //Make sure you can at least play the standard game
    Contest::TravellersDilemmaJudge judge(players, 2, 100, 2, 10, streams);
    judge.Go();
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  2. #32
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    I updated the judging code today. There were no significant changes; just some code reorganization and the change from random number of turns per round to random number of turns per game.

    After running some preliminary runs, I can say that it looks very interesting! C'mon and get those entries in.

    I need a bit of clarification from those that have already submitted one or more entries. Do you want any of your entries entered more than once in the simulations that allow multiple entries per contestant?
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  3. #33
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341
    Could you post a list of the people who have submitted entries?
    Don't quote me on that... ...seriously

  4. #34
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    > Do you want any of your entries entered more than once in the simulations
    > that allow multiple entries per contestant?

    I'm going to trust that the tournament style will allow me to face all of the entries by any person at least one time. Put me in once.

  5. #35
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    I'm going out of town this weekend, so this will be my last reminder to get those entries in. With any luck, I'll post the results on Monday.
    Quote Originally Posted by Brad0407 View Post
    Could you post a list of the people who have submitted entries?
    I'm struggling with whether or not to do so. Each extra piece of information can influence a strategy.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  6. #36
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Submitted mine just now. I would suggest it be entered only once.

  7. #37
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    Sent.

  8. #38
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Now that the deadline has passed, let's open the floor for discussion.

    I wish I could have had initiated my class with the number of players and the number of turns at the beginning of the round. Then I could have made the perfect entry instead of just the most perfect entry :-)

  9. #39
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    All I'm going to say is that when he looks at my source code, he's going to think something along the lines of, "Whaaaaaaaaaaaa?"

  10. #40
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    The entries and the results have been posted on the site. Thanks everyone for submitting an entry. I would post some commentary, but HTML composition via Notepad tends to be a mind-numbing experience.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  11. #41
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    So... everybody wins?!

  12. #42
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341
    I did better than I expected.
    Don't quote me on that... ...seriously

  13. #43
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Quote Originally Posted by Daved View Post
    So... everybody wins?!
    Heh, just about. If I had to assign winners, it'd probably go something like this:

    Total number of wins in Simulation 1:
    1. Daved - 3
    2. MacGyver - 3
    3. Brad0407 - 2
    4. Darryl - 1
    Total number of wins in Simulation 2:
    1. Darryl - 4
    2. Daved - 2
    3. Brad0407 - 1
    Total number of wins in Simulation 3:
    1. MacGyver - 3
    2. Brad0407 - 3
    3. Daved - 2
    4. Darryl - 1
    Total number of wins in Simulation 4:
    1. Darryl - 4
    2. Daved - 2
    3. Brad0407 - 1
    Total number of wins overall:
    1. Darryl - 10
    2. Daved - 9
    3. Brad0407 - 7
    4. MacGyver - 6
    Congratulations Darryl!


    Seriously though, thank you everyone that participated. I had a ton of fun trying to put together an entry that made just enough sense to gather points, but not so much sense that I ended up playing the lower bound the whole time.
    Last edited by pianorain; 07-02-2007 at 01:52 PM.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  14. #44
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Hindsight.... I should have been way more aggressive with my main bot and I should have submitted multiple entries to assist.

    Nice job, Darryl.

    Thanks, pianorain, for starting this tournament. So...... when's the next one and what subject is it on?

  15. #45
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Aw, that's really too bad. I'll have to do a lot better next time I decide to participate in something.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Expression Evaluator Contest
    By Stack Overflow in forum Contests Board
    Replies: 20
    Last Post: 03-29-2005, 10:34 AM
  2. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  3. WANTED: Contest Master
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-23-2003, 10:15 PM