<commit_before>import sys
import json

my_data = json.loads(open("outputs/problem_1_initial_board.json").read())

x = len(my_data)
y = len(my_data[0])

print "%d, %d\n" % (x, y)

def convert(val):
	if (val == "E"): return "-"
	if (val == "F"): return "X"
	if (val == "U"): return "$"
	return "-"

def printSeparator(y):
	n = y * 2
	while n > 0:
  		n -= 1
  		sys.stdout.write("-"),
	print ""

def printHeader(y):
	z = 0
	n = y
	while n > 0:
  		n -= 1
  		print z % 10,
  		z += 1 
	print ""
	return

def printMap(map_data):
	for i, val in enumerate(map_data):
		if (i % 2 == 1): 
			sys.stdout.write(" ")
		else: 
			sys.stdout.write("")
		for j, row in enumerate(val):
			sys.stdout.write(convert(row) + " "),
		print ""	

#printHeader(y)
#printSeparator(y)
#printMap(my_data)
#printSeparator(y)

move = 0

def program_logic(line):
    global move,y,my_data
    move += 1
    print str(move) + ': ' + line.rstrip()
    printHeader(y)
    printSeparator(y)
    printMap(my_data)
    printSeparator(y)

    sys.stdout.flush()

def read_from_stdin():
    global line_count
    for line in sys.stdin:
        program_logic(line)

def prompt_user():
    print 'Type "quit" to exit.'
    while (True):
        line = raw_input('PROMPT> ')
        if line == 'quit':
            sys.exit()
        program_logic(line)

if __name__ == "__main__":
    if '-' in sys.argv:
        read_from_stdin()
    else:
        prompt_user()<commit_msg>stuff<commit_after>import sys
import json
import time

my_data = json.loads(open("outputs/problem_1_initial_board.json").read())
move = 0

x = len(my_data)
y = len(my_data[0])

#print "%d, %d\n" % (x, y)

def convert(val):
	if (val == "E"): return "-"
	if (val == "F"): return "X"
	if (val == "U"): return "$"
	return "-"

def printSeparator(y):
	out = ''
	n = y * 2
	while n > 0:
  		n -= 1
  		out += '-'
	return out

def printHeader(y):
	out = ''
	z = 0
	n = y
	while n > 0:
  		n -= 1
  		out += str(z % 10) + " "
  		z += 1 
	return out

def printMap(map_data):
	out = ''
	for i, val in enumerate(map_data):
		if (i % 2 == 1): 
			out += " "
		for j, row in enumerate(val):
			out += convert(row) + " "
	return out

def program_logic(line):
    global move,y,my_data
    move += 1
    output = ''
    output += "Move: " + str(move) + ': ' + line.rstrip()
    #output += printHeader(y)
    #output += printSeparator(y)
    #output += printMap(my_data)
    #output += printSeparator(y)
    return output

def read_from_stdin():
    for line in sys.stdin:
        return program_logic(line)

def prompt_user():
    #line = raw_input('')
    line = 'test\nfound\nabc'
#    time.sleep(1)
#        if line == 'quit':
#            sys.exit()
    return program_logic(line)

if __name__ == "__main__":
	if '-' in sys.argv:
		out = read_from_stdin()
		sys.stdout.write(out)
	else:
		for i in range(20):
			#time.sleep(.2)
			out = prompt_user()

			sys.stdout.write("%s" % out)
			import subprocess as sp
			sp.call('clear',shell=True)
			#sys.stdout.flush()
			#out = prompt_user()    
	    #	sys.stdout.write("\r%d" % i)
	   # 	sys.stdout.flush()
{'fraction_non_alphanumeric': 0.17148424813251056, 'fraction_numerical': 0.01104254628126015, 'mean_word_length': 2.693045563549161, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 8, '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': '2711159', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1234, 'n_words': 297}