Skip to content

Instantly share code, notes, and snippets.

@tomnis
tomnis / day6part2.scala
Created December 6, 2025 06:27
day6part2
def part2(data: Seq[String]): Long = {
val grid: Grid[Char] = data.dropRight(1).toArray.map(_.toCharArray).transpose
var grandTotal: Long = 0
var curTotal: Long = 0
var op: Op = null
data.last.zipWithIndex.foreach { case (ch, idx) =>
if (ch == '+') {
curTotal = grid(idx).mkString.trim.toLong
op = (a, b) => a + b
@tomnis
tomnis / day17
Created December 25, 2018 01:16
package org.mccandless.minotaur
import org.scalatest.{FlatSpec, Matchers}
import scala.collection.mutable
class Day17Spec extends FlatSpec with Matchers {
type Board = mutable.Seq[mutable.Seq[Char]]
package com.mccandless
import org.scalatest.{FlatSpec, FunSpec, Matchers}
import scala.collection.mutable
import Day16Spec.registers
package org.mccandless.coolshit.disjointset
import org.scalatest.{FlatSpec, Matchers}
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import scala.io.Source
/**
*
package example
import org.scalatest.{FlatSpec, Matchers}
import scala.io.Source
import scala.collection.mutable
/**
* Created by tomas.mccandless on 12/13/18.
*/
class Day13Spec extends FlatSpec with Matchers {