<commit_before>package jousse.org
package bot

case class Board(board: Vector[Vector[Thing]]) {

  def get(x: Int, y: Int) : Thing = board(x)(y)

}

object Board {

  def initialize(columns: Int, rows: Int, player1: Player, player2: Player) : Board = {

    val rnd = new scala.util.Random
    val range = 1 to 2
    val rdnValue = range(rnd.nextInt(range.length))

    Board( Vector.tabulate(columns, rows){ (i,j) => (i,j) match {
      case (0,0)                                      => if(rdnValue == 1) player1 else player2
      case (x,y) if x == (columns-1) && y == (rows-1) => if(rdnValue == 1) player2 else player1
      case _                                          => new Thing()
    }} )
  }
}<commit_msg>Typesafe get<commit_after>package jousse.org
package bot

case class Board(board: Vector[Vector[Thing]]) {

  def get(x: Int, y: Int) : Option[Thing] = (board lift x).flatMap( _ lift y)

}

object Board {

  def initialize(columns: Int, rows: Int, player1: Player, player2: Player) : Board = {

    val rnd = new scala.util.Random
    val range = 1 to 2
    val rdnValue = range(rnd.nextInt(range.length))

    Board( Vector.tabulate(columns, rows){ (i,j) => (i,j) match {
      case (0,0)                                      => if(rdnValue == 1) player1 else player2
      case (x,y) if x == (columns-1) && y == (rows-1) => if(rdnValue == 1) player2 else player1
      case _                                          => new Thing()
    }} )
  }
}
{'fraction_non_alphanumeric': 0.1411042944785276, 'fraction_numerical': 0.0190865712338105, 'mean_word_length': 2.1502145922746783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1330953', 'n_tokens_mistral': 505, 'n_tokens_neox': 481, 'n_words': 139}