<commit_before>package grouplab;

import java.util.Hashtable;

public class Board {
	Hashtable<Integer, Integer> store;
	int size = 0;
	
	// creates a standard checkers board of dimension 8
	public Board() {
		store = new Hashtable<Integer, Integer>(8*8);
	}
	
	// creates a checkers board of dimension size
	public Board(int s) {
		size = s;
		store = new Hashtable<Integer, Integer>(s*s);
	}
	
	// creates a clone of board b
	public Board(Board b) {
		store = b.store;
		size = b.size;
	}
	
	// converts x, y coords to board index
	public int convertCoord(int x, int y) {
		return (x + (y * size));
	}
	
	// places a piece with id at index
	public void setPiece(int index, int id) {
		if (store.get(index) != 0) {
			System.out.printf("Piece already exists at %d!", index);
			return;
		}
		store.put(index, id);
	}
	
	// get the piece at a given location
	public int pieceAt(int index) {
		return store.get(index);
	}
	
	// detects if a piece is on the last row
	public boolean onLastRow(int index) {
		// TODO
		return false;
	}
	
	// detects if a piece is on the first row
	public boolean onFirstRow(int index) { 
		// TODO
		return false;
	}
	
	// detects if a piece is on the first column
	public boolean onFirstCol(int index) {
		// TODO
		return false;
	}
	
	// detects if a piece is on the last column
	public boolean onLastCol(int index) {
		// TODO
		return false;
	}

	// prints the board to stdout
	public void show() {
		// TODO
	}
	
	// clears all pieces from the board
	public void clear() {
		for (int i = 0; i < size; i++) {<commit_msg>Finished additional methods for Board<commit_after>package grouplab;

import java.util.Hashtable;

public class Board {
	Hashtable<Integer, Integer> store;
	int size = 0;
	
	// creates a standard checkers board of dimension 8
	public Board() {
		store = new Hashtable<Integer, Integer>(8*8);
	}
	
	// creates a checkers board of dimension size
	public Board(int s) {
		size = s;
		store = new Hashtable<Integer, Integer>(s*s);
	}
	
	// creates a clone of board b
	public Board(Board b) {
		store = b.store;
		size = b.size;
	}
	
	// converts x, y coords to board index
	public int convertCoord(int x, int y) {
		return (x + (y * size));
	}
	
	// places a piece with id at index
	public void setPiece(int index, int id) {
		if (store.get(index) != 0) {
			System.out.printf("Piece already exists at %d!", index);
			return;
		}
		store.put(index, id);
	}
	
	// get the piece at a given location
	public int pieceAt(int index) {
		return store.get(index);
	}
	
	// detects if a piece is on the last column
	public boolean onLastCol(int index) {
		if ((index + 1) % size == 0)
			return true;
		return false;
	}
	
	// detects if a piece is on the first column
	public boolean onFirstCol(int index) { 
		if ((index == 0) or (index % size == 0))
			return true;
		return false;
	}
	
	// detects if a piece is on the first row
	public boolean onFirstRow(int index) {
		if (index < size)
			return true;
		return false;
	}
	
	// detects if a piece is on the last row
	public boolean onLastRowint index) {	
		if ((index < Math.pow(size, 2) - size))
			return true;
		return false;
	}

	// prints the board to stdout
	public void show() {
		// TODO
	}
	
	// clears all pieces from the board
	public void clear() {
		for (int i = 0; i < size; i++) {
{'fraction_non_alphanumeric': 0.11202185792349727, 'fraction_numerical': 0.0051608986035215545, 'mean_word_length': 2.8628370457209846, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '2097036', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1107, 'n_words': 428}