<commit_before>package eu.shiftforward.icfpc2015

import eu.shiftforward.icfpc2015.model._

object GameStateRenderer {
  def asString(grid: Grid) = {
    def renderCell(filled: Boolean) = filled match {
      case true => "⟨X⟩"
      case false => "⟨ ⟩"
    }
    def rowString(row: Int) =
      (if (row % 2 == 1) f"$row%02d:   " else f"$row%02d: ") +
        (0 until grid.width).map { col => renderCell(grid.isFilled(col, row)) }.mkString(" ")

    val header = "    " + (0 until grid.width).map { x => f"$x%02d" }.mkString("  ") + "\n"

    header + (0 until grid.height).map(rowString).mkString("\n") + "\n" + "  " + header
  }
}

object GameStateRendererTest extends App {
  println(GameStateRenderer.asString(Grid(10, 15).filled(Cell(2, 2), Cell(2, 3))))
}<commit_msg>Minor rendering fixes<commit_after>package eu.shiftforward.icfpc2015

import eu.shiftforward.icfpc2015.model._

object GameStateRenderer {
  def asString(grid: Grid) = {
    def renderCell(filled: Boolean) = filled match {
      case true => "⟨X⟩"
      case false => "⟨ ⟩"
    }
    def rowString(row: Int) =
      (if (row % 2 == 1) f"$row%02d:   " else f"$row%02d: ") +
        (0 until grid.width).map { col => renderCell(grid.isFilled(col, row)) }.mkString(" ")

    val header = "    " + (0 until grid.width).map { x => f"$x%02d" }.mkString("  ") + "\n"

    "\n" + header + (0 until grid.height).map(rowString).mkString("\n") + "\n" + "  " + header
  }
}

object GameStateRendererTest extends App {
  println(GameStateRenderer.asString(Grid(10, 15).filled(Cell(2, 2), Cell(2, 3))))
}
{'fraction_non_alphanumeric': 0.1840255591054313, 'fraction_numerical': 0.03450479233226837, 'mean_word_length': 3.255434782608696, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2560623', 'n_tokens_mistral': 611, 'n_tokens_neox': 584, 'n_words': 127}