Part 5: Create your Own Player!

Overview

You now should have a basic understanding of CS 105's Hunger Games. You will now need to create your very own player!

Making Your Player

You should be comfortable creating a new player by now. If not, you can review the previous parts of this assignment. You can give your player any name, but it will be public as part of the course-wide contest (so make it decent).

Grading Rubric

Your grade for this project will be based on the number of the simple players you created in Parts 1-4 that your player can beat (Hue the Hunter, Sam the Slacker, Random Riko, and Random Raj). You can test this running a five player game with the four players we created and your own player:

Your solution must reliably beat all four players -- beating them once or only once in a while is not enough. We will give your program at most three chances and use your best result to score your submission.

The key to making a better player is thinking about how to out-smart the other players. Since you know exactly how they work, being able to be smarter than a predictable player should be pretty easy.

You will know that your player is the winner when it the only player remaining on the "End of Day" panel on the right:


Full API

While you probably will not use most of this, here is all of the information your player has access to in order to make a smart decision:


me

Contains information about the player itself.

  • me.food: My food at the beginning of the day.
  • me.reputation: A number in the range [0, 1] that is the percentage of times I hunt (instead of slacking).
  • me.history: An array containing the history of hunting decisions I have made with the current hunting partner.
    • The first day hunting decision will be at me.history[0] and every day after will be added at the end of the array.
    • For example: If today is day six and I slacked for the first four days and hunted on the fifth, me.history holds the array ['s', 's', 's', 's', 'h']

partner

Contains information about the current hunting partner. Holds the exact same data as me, except about the hunting partner.

  • partner.food
  • partner.reputation
  • partner.history: An array containing the history of my current hunting partner's hunting decisions with me.

capital

Contains information related to the Game in the capital:

  • capital.day: The current day. (Number)
  • capital.blessingThreshold: The threshold in order for all players to recieve The Capital Blessing for extra food; stored as a percentage in the range [0, 1].
    • The value 0.2 indicates that 20% of players must hunt for the Capital Blessing to be active.
  • capital.blessingThresholdHistory: An array containing previous days' blessingThreshold values. Just like me.history, each day is added to the end of the array. (v1.1+)
  • capital.huntParticipationHistory: An array containing previous days' hunt participation, the percentage of all players who hunted (instead of slacking) on a given day. If capital.huntParticipationHistory[i] is greater than capital.blessingThresholdHistory[i], the Capital Blessing was applied on that specific day. (v1.1+)
  • capital.initialPlayers: The number of inital players in the current game. (v1.1+)
  • capital.currentPlayers: The number of current (remaining) players in the current game. (v1.1+)

Course-Wide Contest

Contest Overview

When you submit your solution, your solution will become part of the course-wide CS 105 Hunger Games! The CS 105 server is continuously running The Game, starting a new Game as soon as the old one finishes. This means you will get to test your skill and wit aganist all of the other studnets and staff of CS 105!

The full 60/60 points for thie project is earned outside of this contest. However, as part of this contest, you can earn extra credit:

The extra credit will be judged by by using the final run of the contest. Sadly, simply having a better score than someone once does not earn you the extra credit.

Contest Specifics

Since your player can only enter when a new game begins, it may take 10-20 minutes after you submit your player for the existing game to finish and for the game with your player to complete. Don't worry if you don't see your player right away!

We reserve the right to disqualify you from the contest portion of this project. If you are disqualifed, your forfit any chance to earn extra credit. Reasons for disqualification includes:

Live Results

Submit Your Player