<commit_before># -*- coding: utf-8 -*-
from turn import *
from draw import *

#players setup
players = [None]*width
for i in range(len(players)):
    players[i] = [0]*height

plist = []
for i in range(amount_of_players):
    plist.append(max(AMOUNT_OF_PLAYERS)/amount_of_players*i)
#print plist
player_list = []
for i in plist:
    player_list.append({'id': i, 
                        'location': PLAYERS[i]['location'], 
                        'amount_of_walls': AMOUNT_OF_WALLS/amount_of_players,
                        'target_loc': PLAYERS[i]['target_loc']
    })

for player in player_list:
    (x, y) = player['location']
    players[x][y] =  player['id']      

wall_list = []
#wall_list = [{'type': 'vertical', 'x': X, 'y': Y}]
#wall_list = [{'type': 'horizontal', 'location': (X, Y)}]

end = False
win = False
p = 0

curscr = None
if enable_curses:
    curscr = curses.initscr()
    curses.curs_set(0)

draw(player_list, wall_list, curscr)
while not end:
    while True:
        #occupied cells
        loc = player_list[p*amount_of_players/max(AMOUNT_OF_PLAYERS)]['location']
        available_positions = available_positions_generator(loc, wall_list, player_list)

        if PLAYERS[p]['owner'] == 'user':
            end = user_turn(player_list, player_list[p*amount_of_players/max(AMOUNT_OF_PLAYERS)], wall_list, available_positions, players, curscr)
        else:
            #print p
            bot_turn(PLAYERS[p], player_list[p*amount_of_players/max(AMOUNT_OF_PLAYERS)], player_list, wall_list, available_positions, players)

        draw(player_list, wall_list, curscr)

        if player_list[p*amount_of_players/max(AMOUNT_OF_PLAYERS)]['location'] in PLAYERS[p]['target_loc']:
            end = True
            print "Player %d '%s' win"% (p, PLAYERS[p]['owner'])
 
        if end:
            if enable_curses:
                curses.endwin()
            break
        p += max(AMOUNT_OF_PLAYERS)/amount_of_players
        p %= max(AMOUNT_OF_PLAYERS)<commit_msg>printing game result<commit_after># -*- coding: utf-8 -*-
from turn import *
from draw import *

#players setup
players = [None]*width
for i in range(len(players)):
    players[i] = [0]*height

plist = []
for i in range(amount_of_players):
    plist.append(max(AMOUNT_OF_PLAYERS)/amount_of_players*i)
#print plist
player_list = []
for i in plist:
    player_list.append({'id': i, 
                        'location': PLAYERS[i]['location'], 
                        'amount_of_walls': AMOUNT_OF_WALLS/amount_of_players,
                        'target_loc': PLAYERS[i]['target_loc']
    })

for player in player_list:
    (x, y) = player['location']
    players[x][y] =  player['id']      

wall_list = []
#wall_list = [{'type': 'vertical', 'x': X, 'y': Y}]
#wall_list = [{'type': 'horizontal', 'location': (X, Y)}]

end = False
win = False
p = 0

curscr = None
if enable_curses:
    curscr = curses.initscr()
    curses.curs_set(0)

draw(player_list, wall_list, curscr)
while not end:
    while True:
        #occupied cells
        loc = player_list[p*amount_of_players/max(AMOUNT_OF_PLAYERS)]['location']
        available_positions = available_positions_generator(loc, wall_list, player_list)

        if PLAYERS[p]['owner'] == 'user':
            end = user_turn(player_list, player_list[p*amount_of_players/max(AMOUNT_OF_PLAYERS)], wall_list, available_positions, players, curscr)
        else:
            #print p
            bot_turn(PLAYERS[p], player_list[p*amount_of_players/max(AMOUNT_OF_PLAYERS)], player_list, wall_list, available_positions, players)

        draw(player_list, wall_list, curscr)

        if player_list[p*amount_of_players/max(AMOUNT_OF_PLAYERS)]['location'] in PLAYERS[p]['target_loc']:
            end = True
            win = True
 
        if end:
            if enable_curses:
                curses.endwin()
            break

        p += max(AMOUNT_OF_PLAYERS)/amount_of_players
        p %= max(AMOUNT_OF_PLAYERS)

if win:
    print "Player %d '%s' win"% (p, PLAYERS[p]['owner'])
{'fraction_non_alphanumeric': 0.1341645885286783, 'fraction_numerical': 0.00199501246882793, 'mean_word_length': 3.0271084337349397, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1573228', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1360, 'n_words': 279}