<commit_before>from random import randint

class Board:
	
	def __init__(self):
		self.table = [[0] * 4 for _ in range(4)]
		self.score = 0
		self.won = False

	def display(self):
		print("Score: {0}" .format(self.score))
		for row in self.table:
			print(row)

	def zeroExists(self):
		for row in self.table:
			for cell in row:
				if cell == 0:
					return True

	def insert(self):	
		if self.zeroExists():
			col = randint(0,3)
			row = randint(0,3)
			if self.table[row][col] == 0:
				self.table[row][col] = 2
			else:
				self.insert()

	def isMoveValid(self,move):
		if move == 'W' or move == 'w':
			return self.checkMoveUp()
		elif move == 'A' or move == 'a':
			return self.checkMoveLeft()
		elif move == 'S' or move == 's':
			return self.checkMoveDown()
		elif move == 'D' or move == 'd':
			return self.checkMoveRight()

	def moveBoard(self,dir):
		if move == 'W' or move == 'w':<commit_msg>added function so that new cells have 10% chance to be a 4 instead of a 2<commit_after>from random import randint

class Board:
	
	def __init__(self):
		self.table = [[0] * 4 for _ in range(4)]
		self.score = 0
		self.won = False

	def display(self):
		print("Score: {0}" .format(self.score))
		for row in self.table:
			print(row)

	def zeroExists(self):
		for row in self.table:
			for cell in row:
				if cell == 0:
					return True

	def insert(self):	
		if self.zeroExists():
			col = randint(0,3)
			row = randint(0,3)
			if self.table[row][col] == 0:
				twofour = randint(0,10)
				if twofour == 0:
					self.table[row][col] = 4
				else:
					self.table[row][col] = 2
			else:
				self.insert()

	def isMoveValid(self,move):
		if move == 'W' or move == 'w':
			return self.checkMoveUp()
		elif move == 'A' or move == 'a':
			return self.checkMoveLeft()
		elif move == 'S' or move == 's':
			return self.checkMoveDown()
		elif move == 'D' or move == 'd':
			return self.checkMoveRight()

	def moveBoard(self,dir):
		if move == 'W' or move == 'w':
{'fraction_non_alphanumeric': 0.1557711950970378, 'fraction_numerical': 0.016853932584269662, 'mean_word_length': 3.02258726899384, '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': '6654434', 'n_tokens_mistral': 853, 'n_tokens_neox': 717, 'n_words': 223}