<commit_before>
class AI

	def initialize

	end

	def compute_score(board_array, player_id)


	end

	def compute_horizontal_score(board_array, player_id, enemy_id,direction)

		score_hash = Hash.new
		board_array.each_with_index do |row , row_index|
			score_counter = 0
			# score_counter_enemy=0
			player_self =true
			found_piece = false
			row=(direction)? row : row.reverse
			p row
			row.each_with_index do |column, column_index|
				c_index=(direction)? column_index : 6 - column_index
				if board_array[row_index][c_index] != 0
					found_piece = true
				end

				if player_id == board_array[row_index][c_index] && player_self == true
					score_counter=score_counter+1

				end

				if player_id == board_array[row_index][c_index] && player_self == false
					score_counter = 0
					player_self = true

				end

				if enemy_id == board_array[row_index][c_index] && player_self == true
					score_counter = 0
					player_self = false

				end


				if enemy_id == board_array[row_index][c_index] && player_self == false
					score_counter=score_counter+1
				end

				if board_array[row_index][c_index] == 0 && found_piece
					p board_array[row_index][c_index]
					id =(player_self)? player_id : enemy_id
					if score_counter == 0
						score_counter=1
					end
					score = score_counter*10 +((player_self)? 5 : 0)
					p id
					score_hash[[row_index,c_index]]=[id,score]
					found_piece = false
				end

			end

		end
		return score_hash
	end



	def compute_vertical_score(board_array, player_id, enemy_id)
		# gravity makes this nice
		score_hash = Hash.new

		for column_index in 0..board_array[0].length-1
			board_array.each_with_index do |row , row_index|
				p board_array[row_index][column_index]
			end
		end

		return score_hash
	end

	def compute_left_diagonal_score

	end

	def compute_right_diagonal_score

	end


end
ai = AI.new
board_array = Array.new(6){Array.new(7,0)}
board_array[0][0] = 2
board_array[0][1] = 1
board_array[0][6] = 2
board_array[1][0] = 1<commit_msg>fixed horiz<commit_after>
class AI

	def initialize

	end

	def compute_score(board_array, player_id)


	end

	def compute_horizontal_score(board_array, player_id, enemy_id,direction)

		score_hash = Hash.new
		board_array.each_with_index do |row , row_index|
			score_counter = 0
			# score_counter_enemy=0
			player_self =true
			found_piece = false
			row=(direction)? row : row.reverse
			p row
			row.each_with_index do |column, column_index|
				c_index=(direction)? column_index : 6 - column_index
				if board_array[row_index][c_index] != 0
					found_piece = true
				end

				if player_id == board_array[row_index][c_index] && player_self == true
					score_counter=score_counter+1

				end

				if player_id == board_array[row_index][c_index] && player_self == false
					score_counter = 0
					player_self = true

				end

				if enemy_id == board_array[row_index][c_index] && player_self == true
					score_counter = 0
					player_self = false

				end


				if enemy_id == board_array[row_index][c_index] && player_self == false
					score_counter=score_counter+1
				end

				if board_array[row_index][c_index] == 0 && found_piece
					p board_array[row_index][c_index]
					id =(player_self)? player_id : enemy_id
					if score_counter == 0
						score_counter=1
					end
					score = score_counter*10 +((player_self)? 5 : 0)
					p id
					score_hash[[row_index,c_index]]=[id,score]
					found_piece = false
				end

			end

		end
		return score_hash
	end



	def compute_vertical_score(board_array, player_id, enemy_id)
		# gravity makes this nice
		score_hash = Hash.new

		for column_index in 0..board_array[0].length-1
			board_array.each_with_index do |row , row_index|
				p board_array[row_index][column_index]
			end
		end


		return score_hash
	end

	def compute_left_diagonal_score

	end

	def compute_right_diagonal_score

	end


end
ai = AI.new
board_array = Array.new(6){Array.new(7,0)}
board_array[0][0] = 2
board_array[0][1] = 1
board_array[0][6] = 2
board_array[1][0] = 1
{'fraction_non_alphanumeric': 0.09229234222998253, 'fraction_numerical': 0.016462958343726616, 'mean_word_length': 3.5828571428571427, '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': '5569618', 'n_tokens_mistral': 1758, 'n_tokens_neox': 1396, 'n_words': 310}