<commit_before>package game;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashMap;


public class Scoreboard implements Cloneable {

	public int[] scoreArray;
	
	//Map layout
	//      13       6
	//xxxxxxxxxxxxxvvvvvv
	//x: scoretypes
	//v: upper value
	final static int upperMask = (1 << 6) - 1;
	final static int typesMask = ((1 << 13) - 1) << 6;
	public static boolean isFilled(int scoreboard, int scoretype)
	{
		return (scoreboard & 1 << (6+scoretype)) != 0;
	}
	public static int fill(int scoreboard, int scoretype, int value)
	{
		if (scoretype < 6)
		{
			int upper = (scoreboard & upperMask) + value; //calculate new upper value
			scoreboard = (scoreboard & typesMask) + upper; //reuse only types and add upper
		}
		return scoreboard | 1 << (6+scoretype);
	}
	public static int upperValue(int scoreboard)
	{<commit_msg>Fixed scoreboard upper value overflow<commit_after>package game;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashMap;


public class Scoreboard implements Cloneable {

	public int[] scoreArray;
	
	//Map layout
	//      13       6
	//xxxxxxxxxxxxxvvvvvv
	//x: scoretypes
	//v: upper value
	final static int upperMask = (1 << 6) - 1;
	final static int typesMask = ((1 << 13) - 1) << 6;
	public static boolean isFilled(int scoreboard, int scoretype)
	{
		return (scoreboard & 1 << (6+scoretype)) != 0;
	}
	public static int fill(int scoreboard, int scoretype, int value)
	{
		if (scoretype < 6)
		{
			int upper = (scoreboard & upperMask) + value; //calculate new upper value
			upper = (upper > 63) ? 63 : upper;
			scoreboard = (scoreboard & typesMask) + upper; //reuse only types and add upper
		}
		return scoreboard | 1 << (6+scoretype);
	}
	public static int upperValue(int scoreboard)
	{
{'fraction_non_alphanumeric': 0.11664841182913473, 'fraction_numerical': 0.0208105147864184, 'mean_word_length': 3.488943488943489, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6478193', 'n_tokens_mistral': 654, 'n_tokens_neox': 597, 'n_words': 199}