English 中文(简体)
岩石纸质变器机器人算法
原标题:Rock paper Scissors bot algorithm

In my school our teacher is holding a Rock, paper, scissors bot competition. I know how to program in Python, but I have no idea how to program a bot that would have a bigger chance of success than one that randomly selects its weapons. I think it is possible to store all previous moves and then look for patterns in order to defy attacks. Am I going in a right direction? Any ideas?

最佳回答

It is proven for rock-paper-scissors that a random bot will be at the median of each rank.
Therefore, I d create a set of bots, each calculating one heuristic and running on the background on parallel. For each turn, each bot will virtually "draw" and check if he had won or lost - if it would have played this turn. Each bot will keep track on how many games it would have won if it played, and how many it would have lost.
One of these bots will be the random attacker.

每次都由你来做:choose,但迄今为止,机器人赢得了最优秀的。 [原文]——并使用。

采用这一方法,你被保证在你那类中位的顶端: [足量游戏]

问题回答

如果你为人类玩.,你就走上正轨。 停止以前的行动至关重要。 http://andrewgelman.com/2007/05/how_to_win_at_r/“rel=”nofollow。 如何在岩石、纸张、裂变器上获胜。 http://en.wikipedia.org/wiki/Rock-paper-scissors#Strategies” rel=“nofollow” 战略和算法

Rock Paper Scissors Programming Competition site contains a large number of competing programs (they are even written in python).

如果这是你的学校任务,则可以认为是欺骗性的,因为所有提交的资料来源都是公开的。 但随后,其他学生也可获得这些奖学金。

Where might be some potential profit in trying to figure out the strategies of the other bots, for instance, if it s a forced participation, there will be some lazy student who makes up a bot that would always throw up scissors.

I propose another strategy (I ve heard about it on some similar competition, but can t track the source anymore), suppose that you could let several bots running (if not, cooperate with some of your classmates to run this strategy).

让我说,你有4个机器人A、B、C、D

每个机器人玩弄100次对他人的游戏。 让我们的B、C、D的机器人首先想说,10次采取战略,让你们认识到自己是你的团队的机器人,如RPPSPPSSRS,让你们的机器人采取其他一些战略,让B、C、D等机器人认识到这一战略。

然后,在下一个90轮中,B、C、D的机器人向A失去(纸面),对他人任意玩弄。 让B、C、D的A赢家(科学家)任意对他人进行打击。

因此,机器人A获得了巨大优势。





相关问题
How to add/merge several Big O s into one

If I have an algorithm which is comprised of (let s say) three sub-algorithms, all with different O() characteristics, e.g.: algorithm A: O(n) algorithm B: O(log(n)) algorithm C: O(n log(n)) How do ...

Grokking Timsort

There s a (relatively) new sort on the block called Timsort. It s been used as Python s list.sort, and is now going to be the new Array.sort in Java 7. There s some documentation and a tiny Wikipedia ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Enumerating All Minimal Directed Cycles Of A Directed Graph

I have a directed graph and my problem is to enumerate all the minimal (cycles that cannot be constructed as the union of other cycles) directed cycles of this graph. This is different from what the ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签