4596b34c587f0cf1e96400896960cbb5c10989ed,snake/game.py,Game,__game_main,#Game#,122

Before Change


    def __game_main(self):
        if not self.__map.has_food():
            self.__map.create_rand_food()
        if not self.__pause and not self.__snake.dead and not self.__map.is_full():
            if self.__conf.enable_AI:
                self.__update_direc(self.__solver.next_direc())
            if self.__conf.show_gui and self.__snake.direc_next != Direc.NONE:
                self.__write_logs()
            self.__snake.move()

    def __update_direc(self, new_direc):
        if Direc.opposite(new_direc) != self.__snake.direc:
            self.__snake.direc_next = new_direc
            if self.__pause:

After Change


            self.__map.create_rand_food()

        if self.__pause or self.__episode_end():
            return

        if self.__conf.enable_AI:
            self.__update_direc(self.__solver.next_direc())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: chuyangliu/snake
Commit Name: 4596b34c587f0cf1e96400896960cbb5c10989ed
Time: 2017-12-20
Author: chuyang.s.liu@gmail.com
File Name: snake/game.py
Class Name: Game
Method Name: __game_main


Project Name: mailgyc/doudizhu
Commit Name: b1d471b8eea6caed281325a4b00885b7ee2dd736
Time: 2020-02-20
Author: 4143964+mailgyc@users.noreply.github.com
File Name: doudizhu/apps/game/player.py
Class Name: Player
Method Name: handle_leave


Project Name: mailgyc/doudizhu
Commit Name: d13b23069e1dea5d89bc261e199ec4f97268dbd2
Time: 2020-02-16
Author: 4143964+mailgyc@users.noreply.github.com
File Name: doudizhu/apps/game/room.py
Class Name: Room
Method Name: arrange_seat