[Community Puzzle] Simple AI duels

Ah I found my mistake. This part of the instruction gave me the clue excluding the current turn

When checking the previous action I was also taking last action, also if it was generated this round. For example if player 2 needs to check the actions of the opponent should you also look at the action generated in current round or not?

After only taking previous (completed) rounds in account my code worked.

I agree, that although I had fun solving this puzzle, it’s one of the hardest in the easy category.

1 Like

Hello, i’m trying to solve the puzzle and i have some questions about it.
I don’t understand well how to calculate the random number , i get the formula 137*x+187 mod 256→x. but i don’t know what is x.
Can you provide me an example ?

Secundo :wink: what is exacly the number of turn for a game? each player seems to have diffrerent length of action list…

Thank you for you’re help

x is initialized somewhere, the number of turns too.

1 Like

So X must be the number of previous actions i presume. I’ll try and see …

For the number of turn now :slight_smile: . in this exemple

100
1 Joker
* RAND
3 TitForTat
START C
OPP -1 C C
OPP -1 D D

Do we stop the game after 3 turns; 1 turn; Or do we continue until the end of the 100 turns.

Nice puzzle by the way.

No X is initialised with a value as described in the description of the RAND action.

Regarding the turns, you need to output The name of the winner AI, or DRAW in case of equality, after the specified number of turns have been played. So 100 in this example.

1 Like

Thank you for the reply, in fact i found the formula for the RAND calculation allready. What i’m not sur off is where to find the value for X for this function.
is it X the number of turn allready played