This is a rock paper scissors competition. Algorithms will face each other in 100 rounds of rock paper scissors. Except that the algorithms will also be able to read the source code of each other!
Leaderboard
1. Chaos Bot (by Aiden4) - 27 Points, 168 bytes
2. Anti-99%-of-posts (by Lyxal) - 24 Points, 489 bytes
3. Psuedo-Hash Cycle (by qwatry) - 23 Points, 143 bytes
4. Destroyer of Bots (by Baby_Boy) - 23 Points, 433 bytes
5. If-If (by PkmnQ) - 21 Points, 63 bytes
6. Biased-Cycler (by HighlyRadioactive) - 20 Points, 17 bytes
7. RadiationBot v0.1 (by HighlyRadioactive) - 18 Points, 121 bytes
8. Cycler (by petStorm) - 17 Points, 17 bytes
9. Craker (by petStorm) - 17 Points, 58 bytes
10. Lookup (by petStorm) - 17 Points, 61 bytes
11. Custom (by petStorm) - 16 Points, 56 bytes
12. Anti-Cycler (by Lyxal) - 14 Points, 17 bytes
13. Mr. Paper - 13 Points, 58 bytes
14. PseudoRandom (by HighlyRadioactive) - 13 Points, 89 bytes
15. Itna-Cycler (by petStorm) - 11 Points, 17 bytes
16. Lycler (by petStorm) - 11 Points, 24 bytes
17. Mr. Rock - 11 Points, 57 bytes
18. Mr. Scissors - 10 Points, 61 bytes
Submissions are graded automatically via an online judge
The Competition
Your code will be a javascript anonymous function (sorry, other languages aren't supported!) that takes in two arguments:
- The source code of your opponent AI (as a string)
- The current round number
It should then return one of "R", "P", or "S", indicating that it will throw a rock, paper, or scissors for that round.
Your code must follow these rules, otherwise it will be disqualified:
- Your code may not be longer than 500 bytes
- Your function must be pure
- That is, if your function is given the same set of arguments, your code must always return the same result
- This is to ensure that the tournament results are consistent
- eval() calls are banned!
- If this were allowed, two submissions with eval() would end up calling each other in an endless loop which would never terminate.
- (See the discussion in the comments for more details/reasoning)
- Your code may not:
- Access external resources (e.g. make web fetch/get requests)
- Attempt to modify or tamper with the judge system code
- Cause excessive lag or time delay
- Modify any globals or object prototypes
- Attempt to do an XSS attack or any other sketchy/illegal stuff
Example submission
(code, round) => {
if (round === 1) {
// Throw rock if it's the first round
return "R";
}
else if (code.includes('"R"')) {
// Throw paper if the opponent code includes "R"
return "P";
} else {
// Otherwise throw scissors
return "S";
}
}
Tournament structure
Each submission will play 100 rounds of rock paper scissors with each other submission.
To get the ball rolling, the following three functions will be submitted by default:
(code, round) => {
// Always throw rock
return "R";
}
(code, round) => {
// Always throw paper
return "P";
}
(code, round) => {
// Always throw scissors
return "S";
}
Scoring
A submission gains 2 points for winning against another submission, and 1 point for tying against another submission (no points are awarded for losses).
Leaderboard positions are ordered by most points first. If two submissions have the same number of points, they will be ranked in order of least bytes. If two submissions have the same number of points and bytes, the older submission will be ranked higher.
Judging & Testing
Post your submissions here, I will periodically add submissions to the online judge which will automatically rank each algorithm.
You can also test your algorithms using the online judge testing area. A testing area is provided at the bottom to test different algorithms against each other.