Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answerthis answer.
  • The winner will be chosen on January 28.

Leaderboard

The winner is ConservatorConservator.

Honorable mention to GustavGustav, the highest scoring player with a non-constant strategy.

  • Conservator - 36226
  • High - 36115
  • FloorHugger - 35880
  • NumberOne - 35791
  • Overestimator - 35791
  • Gustav - 35484
  • Historian - 35201
  • Sampler - 34960
  • Incrementer - 34351
  • JumpRightIn - 34074
  • Vickrey - 34020
  • Teenager - 33907
  • Randu - 33891
  • Weightlifter - 33682
  • Middleman - 33647
  • BounceInwards - 33529
  • NastyMathematician - 33292
  • Jumper - 33244
  • Copycat - 33049

The full results can be found here. (I recommend disabling text wrapping.)

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answer.
  • The winner will be chosen on January 28.

Leaderboard

The winner is Conservator.

Honorable mention to Gustav, the highest scoring player with a non-constant strategy.

  • Conservator - 36226
  • High - 36115
  • FloorHugger - 35880
  • NumberOne - 35791
  • Overestimator - 35791
  • Gustav - 35484
  • Historian - 35201
  • Sampler - 34960
  • Incrementer - 34351
  • JumpRightIn - 34074
  • Vickrey - 34020
  • Teenager - 33907
  • Randu - 33891
  • Weightlifter - 33682
  • Middleman - 33647
  • BounceInwards - 33529
  • NastyMathematician - 33292
  • Jumper - 33244
  • Copycat - 33049

The full results can be found here. (I recommend disabling text wrapping.)

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answer.
  • The winner will be chosen on January 28.

Leaderboard

The winner is Conservator.

Honorable mention to Gustav, the highest scoring player with a non-constant strategy.

  • Conservator - 36226
  • High - 36115
  • FloorHugger - 35880
  • NumberOne - 35791
  • Overestimator - 35791
  • Gustav - 35484
  • Historian - 35201
  • Sampler - 34960
  • Incrementer - 34351
  • JumpRightIn - 34074
  • Vickrey - 34020
  • Teenager - 33907
  • Randu - 33891
  • Weightlifter - 33682
  • Middleman - 33647
  • BounceInwards - 33529
  • NastyMathematician - 33292
  • Jumper - 33244
  • Copycat - 33049

The full results can be found here. (I recommend disabling text wrapping.)

Notice removed Reward existing answer by Ypnypn
Bounty Ended with Emil's answer chosen by Ypnypn
Notice added Reward existing answer by Ypnypn
Bounty Started worth 100 reputation by Ypnypn
added 358 characters in body
Source Link
Ypnypn
  • 10.9k
  • 2
  • 31
  • 80

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answer.
  • The winner will be chosen on January 28.

Leaderboard

The winner is Conservator.

Honorable mention to Gustav, the highest scoring player with a non-constant strategy.

  • Conservator - 2466936226
  • High - 2452336115
  • FloorHugger - 2411335880
  • NumberOne - 2403335791
  • Overestimator - 2403335791
  • IncrementerGustav - 2371335484
  • Historian - 35201
  • Sampler - 2358234960
  • HistorianIncrementer - 2345734351
  • JumpRightIn - 34074
  • Vickrey - 2343934020
  • JumpRightInTeenager - 2331433907
  • Randu - 2301233891
  • CopycatWeightlifter - 2243233682
  • WeightlifterMiddleman - 2236433647
  • BounceInwards - 33529
  • NastyMathematician - 33292
  • Jumper - 33244
  • Copycat - 33049

The full results can be found here. (I recommend disabling text wrapping.)

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answer.
  • The winner will be chosen on January 28.

Leaderboard

  • Conservator - 24669
  • High - 24523
  • FloorHugger - 24113
  • NumberOne - 24033
  • Overestimator - 24033
  • Incrementer - 23713
  • Sampler - 23582
  • Historian - 23457
  • Vickrey - 23439
  • JumpRightIn - 23314
  • Randu - 23012
  • Copycat - 22432
  • Weightlifter - 22364

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answer.
  • The winner will be chosen on January 28.

Leaderboard

The winner is Conservator.

Honorable mention to Gustav, the highest scoring player with a non-constant strategy.

  • Conservator - 36226
  • High - 36115
  • FloorHugger - 35880
  • NumberOne - 35791
  • Overestimator - 35791
  • Gustav - 35484
  • Historian - 35201
  • Sampler - 34960
  • Incrementer - 34351
  • JumpRightIn - 34074
  • Vickrey - 34020
  • Teenager - 33907
  • Randu - 33891
  • Weightlifter - 33682
  • Middleman - 33647
  • BounceInwards - 33529
  • NastyMathematician - 33292
  • Jumper - 33244
  • Copycat - 33049

The full results can be found here. (I recommend disabling text wrapping.)

added 349 characters in body
Source Link
Ypnypn
  • 10.9k
  • 2
  • 31
  • 80

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answer.
  • The winner will be chosen on January 28.

Leaderboard

  • Conservator - 24669
  • High - 24523
  • FloorHugger - 24113
  • NumberOne - 24033
  • Overestimator - 24033
  • Incrementer - 23713
  • Sampler - 23582
  • Historian - 23457
  • Vickrey - 23439
  • JumpRightIn - 23314
  • Randu - 23012
  • Copycat - 22432
  • Weightlifter - 22364

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answer.

Every player has a number. Can yours be the farthest from them all?

Requirements

Write a Java, Python 2, or Ruby function named choose() that accepts three arguments:

  • an integer - the number of rounds already completed
  • an integer - the number of players
  • an array of strings - the results of each previous round
    • each string is a space-separated list of integers, sorted from lowest to highest

For example, choose(2, 4, ["4 93 93 174", "1 84 234 555"]) means:

  • there were already two rounds (this is the third round)
  • there are a total of four players
  • in the first round, the numbers chosen were 4, 93, 93, 174
  • in the second round, the numbers chosen were 1, 84, 234, 555

You must return a whole number from 1 to 999 (inclusive).

For each other player, your score is the square root of the distance between your number and theirs. Your score for the round is the total of all of these scores.

100 rounds will be played. The highest total score wins!

Rules

  • Your code may not use any I/O, including console, files, network, etc.
  • You may not interfere with the control program or any other players.
  • Programs which look like they violate the above rules will be excluded.
  • Each call of a function should take under five seconds on my computer (Intel Core i5 2450M with 8GB of RAM).
  • If a program throws an exception or returns an invalid value, it will be treated as if it returned 1.
  • Each user may submit at most one program.

Miscellaneous

  • The control program is on GitHub.
  • There are three built-in players. They can be found in this answer.
  • The winner will be chosen on January 28.

Leaderboard

  • Conservator - 24669
  • High - 24523
  • FloorHugger - 24113
  • NumberOne - 24033
  • Overestimator - 24033
  • Incrementer - 23713
  • Sampler - 23582
  • Historian - 23457
  • Vickrey - 23439
  • JumpRightIn - 23314
  • Randu - 23012
  • Copycat - 22432
  • Weightlifter - 22364
Tweeted twitter.com/#!/StackCodeGolf/status/558042455380344832
Source Link
Ypnypn
  • 10.9k
  • 2
  • 31
  • 80
Loading