这是一场石头剪刀比赛。算法将在100轮岩石剪刀中互相面对。除了算法还可以读取对方的源代码外!
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
意见书通过在线法官自动评分。
您的代码将是一个javascript匿名函数(对不起,不支持其他语言!)这包括两个论点:
然后,它应该返回一个"R","P",或"S",表示它将扔石头,纸,或剪刀为这一轮。
您的代码必须遵循这些规则,否则它将被取消资格:
(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";
}
}
每一次提交将播放100轮石头剪刀与彼此提交。
为了使球滚动,默认情况下将提交以下三个函数:
(code, round) => {
// Always throw rock
return "R";
}
(code, round) => {
// Always throw paper
return "P";
}
(code, round) => {
// Always throw scissors
return "S";
}
一份意见书因在另一份意见书中获胜而获得2分,在另一份意见书上获得1分(损失不分)。
排在第一位的位置是按多数分数排列的。如果两份意见书有相同的分数,它们将被排序为最少字节。如果两个提交的提交具有相同的点数和字节数,则将对较早提交的提交进行更高的排名。
在这里发布您的提交,我将定期添加提交到在线裁判,这将自动排列每一个算法。
您还可以使用在线裁判测试区域测试您的算法。在底部提供测试区域,以相互测试不同的算法。
发布于 2020-08-11 19:21:15
我不知道这里发生了什么,但除了标准的骑手之外,它似乎赢得了所有的东西。
(c,r) => {if(c.includes("else")){return "SSR"[r%3];}if(c.includes("/")){if(c.includes("P")){return "S";//17
} return "SRP"[r%3];} else{return "PPS"[(c.length + r)%3];}}
发布于 2020-08-10 04:28:07
(code,r)=>{var S="S";var R="R";var P="P";var x=S+R+P;var y=R+P+S;var z=P+S+R
if(code.includes("17")){return "P";}
else if(code.includes("[r%2]")){return"RR"[r%2]}
else if(code.includes("[r%3]")){
if (code.includes(x)){return (R+P+S)[r%3];}
else if(code.includes(y)){return (P+S+R)[r%3];}
else if(code.includes(z)){return (S+R+P)[r%3];}
}else{if(code.includes("scissors")){return "R"}else if (code.includes("rock")){return "P"}else if (code.includes("paper") ){return "S"}else{return "P"}}}
哈哈。在提交的文件上进行测试,要么是赢,要么是平分。
发布于 2020-08-10 17:55:26
(c,r)=>{if(c.includes("i")){return"RPS"[2]}else{return"P"}; 17}
这是根据一种算法构建的,该算法检测代码中是否存在" if“。
https://codegolf.stackexchange.com/questions/209243
复制相似问题