Spring Challenge 2020 - Bugs & Questions

hey, If my pac died, Is its id given in input?(in bronze league) As I am constantly getting pac_id of my dead piece as input.

Your pacman with ID 2 died, yet you print: “MOVE 0 1 3 |MOVE 1 11 1 |MOVE 2 15 5 |MOVE 3 19 1 |MOVE 4 29 3 |”
So you lose with the error message “Pac 2 doesn’t exist”.

And dead pacmen are not given in the input. You probably forgot to clear a list or something like that @WaRiOrOfCoDe.

1 Like

Hey, thanks for answering but I am clearing the list every game loop still the problem persists

I even tried to see the input and in the list of pacid input I found that it was entering each id twice

Clearing the list is not helping

edit:
hey i got it thanks

It seems that I occasionally timeout when I try to read the last line of the grid. This is my code (Python 3):

# width: size of the grid
# height: top left corner is (x=0, y=0)
width, height = [int(i) for i in input().split()]
round1 = [[None] * width for _ in range(height)]
prevrow = [None] * width
print(width, height, file=sys.stderr)
begin = time.time()
for y, row1 in enumerate(round1):
    print('ROW', y, time.time() - begin, file=sys.stderr)
    row = input()  # one line of the grid: space " " is floor, pound "#" is wall
    print(row, file=sys.stderr)
    # ... some more code

And on STDERR I get the following output:

31 16
ROW 0 3.5762786865234375e-06
###############################
ROW 1 6.151199340820312e-05
      # #   # ### #   # #      
ROW 2 9.417533874511719e-05
### # # # # # ### # # # # # ###
ROW 3 0.00011873245239257812
    #     #   # #   #     #    
ROW 4 0.00015044212341308594
### # ### ### # # ### ### # ###
ROW 5 0.00016951560974121094
#   #   #             #   #   #
ROW 6 0.0004596710205078125
# # ### # # # ### # # # ### # #
ROW 7 0.0005006790161132812
# #     #   #     #   #     # #
ROW 8 0.0005309581756591797
##### # # ### ### ### # # #####
ROW 9 0.0005486011505126953
# #   #                 #   # #
ROW 10 0.0005757808685302734
# # # ### # # # # # # ### # # #
ROW 11 0.0005950927734375
#     #   #   # #   #   #     #
ROW 12 0.0006208419799804688
##### # # ### # # ### # # #####
ROW 13 0.0006394386291503906
#         #   # #   #         #
ROW 14 0.0006911754608154297
# # ### # # ### ### # # ### # #
ROW 15 0.0007102489471435547

Clearly, this is not a problem of my code taking too long. The rows I can see appear to be matching with the grid as displayed in the animation. The problem persists if I press “REPLAY IN SAME CONDITIONS”, but everything works as expected If I press “PLAY MY CODE” again.

Change your print statements to have flush=True on the end
eg:

print(row, file=sys.stderr, flush=True)

Python buffers output until you access a different stream, so if you have an infinite loop anything sent to stderr after the last input() / print() to stdout won’t be printed.

2 Likes

Ok, so it’s probably a problem with the code following this stuff (infinite loop or whatever). Thank you very much!

EDIT: In fact, my initialization code simply took too long for certain grids.

Thank you so much for your help. :slight_smile:

An addition regarding this issue. After I watched more replays I found out that for some reason only my bots get affected, don’t see other players having this issue :confused:
I thought it may be related to the output format, so I tried to mimic another player style, but without luck.

Our outputs are same but the opponent’s bots don’t get affected by my SPEED. Whether I use it or not, the effect is the same.


Have no idea what to do with it right now. If you have some idea how to workaround it, please advice.

It seems you are not taking advantage of the speed ability. I mean, looks like you are commanding your speeded pacs to move to an adjacent cell, when you should make them move to a cell at least 2 cells away if you want to take profit of the speed.

1 Like

Hey, yes, I choose the adjacent cell to move and that might be the case, I will check it. Thanks.
By the output I expected that the game loop will be twice as fast, my bad.
UPD: Checked and yes, that was the reason.

1 Like

Is there any way to tell when you kill an enemy pac?
For example, if there is a 4 way junction, and a speeding blue rock is moving from the bottom to top, and a speeding red paper is moving from left to right, is there any way that I am missing for the red player to notice his kill?
Because the way I see it, there is no game turn(with inputs, speed turns not included) in which the red player saw the blue one coming.

2 Likes

Its also doesn’t change for me!

Is there a way to run multiple games at once for this?
I’m know pretty much nothing about

  • java
  • github

hey guys just a quick question
Is visible_pac_count shows pac in sight of my pac or in sight of me(on screen)?

I am trying to make a collision detection in python but every implementation make my rank drop by 500+.

Hi all!

I would love to know something about the battles. Is it possible to have different outcomes when replaying a battle or sending it to IDE ? Because with this battle : https://www.codingame.com/replay/460173600 when I send it to my IDE, the outcome is different.
It seems that one of my function which is meant to return a string among [PAPER, SCISSORS, ROCK] only returns the first letter of the string.

Has someone encountered something similar ?
Thanks!

Have you resolved these scenarios? I would like to know if my own simulation is correct. Currently I’m resolving this as: case 1 (eaten), case 1bis (eaten), case 2 (not blocked nor eaten), case 3 (not blocked nor eaten), case 4 (not blocked nor eaten). I considered staying on place equivalent. This is just my own understanding of the rules and would like to know if this is correct as well.

It is possible when you or your opponent uses randomness in the AI.

2 Likes

Hey! I’m noticing the exact same issue!

Here’s a log of a recent simulation (this starts from the first turn). As you can see in the last Game Summary, only the second player is awarded with the SPEED ability enabled!

Standard Output Stream:
SPEED 0 | SPEED 1
Standard Output Stream:
SPEED 0|SPEED 1
Game Summary:
Code.ama:

  • Pac 0 used a speed boost.
  • Pac 1 used a speed boost.
    Illedan:
  • Pac 0 used a speed boost.
  • Pac 1 used a speed boost.
    Standard Output Stream:
    MOVE 0 4 11 | MOVE 1 5 7
    Standard Output Stream:
    MOVE 0 29 11|MOVE 1 26 7
    Game Summary:
    Code.ama:
  • Pac 0 moved to (4, 11).
  • Pac 1 moved to (5, 7).
    Illedan:
  • Pac 0 moved to (28, 11).
  • Pac 1 moved to (27, 7).
    Game Summary:
    Only pacs with the SPEED ability enabled can move:
    Illedan:
  • Pac 0 moved to (29, 11).
  • Pac 1 moved to (26, 7).

Hello!

Following orders (in first turn) will result in different ending scores (“MOVE 0 8 9” is a valid move that eats a Pellet).
“SPEED 2|SPEED 2|MOVE 0 8 9” https://www.codingame.com/replay/460286596
“MOVE 0 8 9|SPEED 2|SPEED 2” https://www.codingame.com/replay/460287309

Regaring to the rules (Action order for one turn), abilities should execute first and the MOVE should not happen at all. Bug or intentional?