50
15
This king-of-the-hill challenge is based off of the game show, Weakest Link. For those unfamiliar with the show, the crux of this challenge deals with who you vote off:
- If the other players are smarter than you, then you have less of a chance of getting the pot.
- If the other players are dumber than you, then you have less of a pot to get.
At the start of each round, the Pot starts out with $0. A group of 9 players is formed, and each player is given a unique Smartness from 1 to 9.
At the start of each turn, Pot += Smartness
for each player still in the round. Then, players vote on the player they wish to remove. The player with the most votes is removed. In case of a tie, the smarter player is kept.
When there are only 2 players are left in the round, they face off in a battle of wits. The chance of the player winning is Smartness/(Smartness+OpponentSmartness)
. The winning player then receives the entire pot.
The player who has received the most money at the end of the game wins.
Input / Output
Each turn, you will receive the current list of opponents. You will have access to your smartness and all players' entire voting history for the round via functions in the Player class.
As output, you must return a single integer, representing the player you wish to vote for (representing their smartness). Voting for yourself is allowed (but not recommended).
Rounds of 9 will repeat until all players have played at least 100010000 rounds, and all players have played in the same number of rounds.
You can find the controller here: https://github.com/nathanmerrill/WeakestLink
To create a player, you need to extend the Player class, and add your player to the PlayerFactory class. Your class must follow the following rules:
Communication or interference with any other player (include your other players of the same type) is strictly prohibited.
Reflection and static variables (except for constants) are not allowed.
If you want to use randomness, I have provided a
getRandom()
function in the Player class. Use it, so simulations can be deterministic.
I have provided many functions in the Player class for easy access to data. You can find them online on Github. Your player will be instantiated each new round. "Dumb/suicidal" players are allowed (but not players with the same strategy).
Scores
377195 WeakestLink.Players.PrudentSniper
362413 WeakestLink.Players.Sniper
353082 WeakestLink.Players.VengefulSniper
347574 WeakestLink.Players.AntiExtremist
298006 WeakestLink.Players.BobPlayer
273867 WeakestLink.Players.MedianPlayer
247881 WeakestLink.Players.TheCult
240425 WeakestLink.Players.Leech
235480 WeakestLink.Players.SniperAide
223128 WeakestLink.Players.Guard
220760 WeakestLink.Players.Anarchist
216839 WeakestLink.Players.RevengePlayer
215099 WeakestLink.Players.IndependentVoter
213883 WeakestLink.Players.SniperKiller
210653 WeakestLink.Players.MaxPlayer
210262 WeakestLink.Players.Bandwagon
209956 WeakestLink.Players.MeanPlayer
208799 WeakestLink.Players.Coward
207686 WeakestLink.Players.Spy
204335 WeakestLink.Players.Hero
203957 WeakestLink.Players.MiddleMan
198535 WeakestLink.Players.MinPlayer
197589 WeakestLink.Players.FixatedPlayer
197478 WeakestLink.Players.HighOrLowNotSelf
181484 WeakestLink.Players.RandomPlayer
165160 WeakestLink.Players.BridgeBurner
1don't get this: "At the start of each round... A group of 9 players is formed, and each player is given a unique Smartness" not at the start of the game start? – CSᵠ – 2015-12-01T05:41:55.570
1@CSᵠ correct. Your smartness changes from round to round (it would be unfair otherwise). – Nathan Merrill – 2015-12-01T05:45:38.270
2must be the stress and joy – CSᵠ – 2015-12-01T05:56:14.203
1Should I expect an ant build config or some such? I'm kinda new to java, and I'm not sure how people usually set up little projects like this one. – Dale Johnson – 2015-12-01T07:12:00.897
4From within
src\WeakestLink
I usedjavac Game\*.java Players\*.java Main.java
to compile andjava -cp .. WeakestLink.Main
to run. – Linus – 2015-12-01T07:22:05.893I feel like this would be a lot more interesting if players could artificaily lower their smartness for each turn. – user253751 – 2015-12-01T23:20:08.203
@immibis I'm not sure how you think that would work. We refer to players by their smartness, so there would be a possibility of multiple players with the same smartness, or if we refer to players by something else, then we can track that their smartness changed. – Nathan Merrill – 2015-12-01T23:58:37.270
@DaleJohnson Or you could easily import the code into your i'd in a new project. – csga5000 – 2015-12-02T04:52:36.147
@NathanMerrill I would have loved having a way to know who had reason when they voted.Too bad for me :p. (Wanted to do a bot voting for the one who voted the most successfully ^^). – Katenkyo – 2015-12-02T07:51:58.357
@Katenkyo figuring out who voted most successfully is definitely possible with the information I've given you. You can track who was in the round last time, figure out who was removed, and then get all of the people that voted for them the last round. – Nathan Merrill – 2015-12-02T13:45:20.660
@NathanMerrill i though the only informations about others I had was : their smartness and their votes. As I can't identify by a name, nor know the exact changement in smartness for each one, I can't actually see an implementation without cases where I don't know who has been excluded. But if you say i can, I'll give it a go when I'll be back Home :). Anyway, well done, it's a pretty funny KotH ^^. – Katenkyo – 2015-12-02T13:49:44.570
1@Katenkyo People's smartness don't change from turn to turn (meaning you can track it within a round). You can't target players that were successful last round though (intentionally). – Nathan Merrill – 2015-12-02T14:01:54.850
@NathanMerrill Ho, didn't understand that, feel stupid now... Voting right gives you an immunity so? Ok taking note, will have to revert it and vote for the least successful so. – Katenkyo – 2015-12-02T14:05:55.683
1Nothing makes you immune from being voted off? What do you mean by "so" – Nathan Merrill – 2015-12-02T14:07:11.483
@NathanMerrill "You can't target players that were successful last round though" wasn't this meaning "they are immune the next turn"? Using the vote list, I could tell if they were right or not, right? and the so was more like "so I will have to revert...." – Katenkyo – 2015-12-04T10:38:04.153
@Katenkyo You have complete information of what has happened in the current round, but the current round only. A round starts with 9 people, and lasts until 1 remains. While the winners of the previous rounds aren't immune, you can't specifically target them, because you have no idea who they are. – Nathan Merrill – 2015-12-04T13:56:13.973
@NathanMerrill My bad here, by round, I was meaning turn ^^' – Katenkyo – 2015-12-04T14:09:45.740
@NathanMerrill It looks like the smartness values in your code are 0-8, doesn't this adversely affect the face-off & pot? Not to mention I wrote some of my code assuming it was 1-9. – Linus – 2015-12-06T09:30:17.610
@Linus what a huge bug. I fixed it (and several players that broke because of the bug). Scores have been updated. – Nathan Merrill – 2015-12-06T14:06:10.253
1@TheNumberOne within a round, you can store as much data as you'd like. Each new round, I make a new instance of your bot, so storing results statically is not allowed. That said, if you can do some statistics on your personal time, and store the results in constants in the code you submit, that's fine as well. – Nathan Merrill – 2015-12-08T00:04:41.590