This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object SerDe { | |
import java.io._ | |
import java.util._ | |
import javax.xml.bind.DatatypeConverter | |
def fromString(s:String ):Any = { | |
val data = DatatypeConverter.parseHexBinary(s) | |
val ois = new ObjectInputStream(new ByteArrayInputStream(data)) | |
val o = ois.readObject() | |
ois.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Point { | |
trait PointAdder[P1, P2] { | |
def add(p1: P1, p2: P2): Point3D | |
} | |
case class Point2D(x: Int, y: Int) | |
case class Point3D(x: Int, y: Int, z: Int) | |
implicit object Point2DAdder extends PointAdder[Point2D, Point2D] { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Point extends App { | |
trait Semigroup[T] { | |
def append(p1: T, p2: T): T | |
} | |
case class Point2D(x: Int, y: Int) | |
case class Point3D(x: Int, y: Int, z: Int) | |
object Point2D { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;the bot is tron.bots.ahoy/turn-based-strat | |
(ns tron.bots.ahoy | |
(:require [tron.core :as tron])) | |