Skip to content

Instantly share code, notes, and snippets.

@GabrielJones646
Last active August 29, 2015 14:21
Show Gist options
  • Save GabrielJones646/11b36945bd5393042c11 to your computer and use it in GitHub Desktop.
Save GabrielJones646/11b36945bd5393042c11 to your computer and use it in GitHub Desktop.
object ScalaJSExample extends js.JSApp{
def main(): Unit = {
val G = """103,2,50,100
|106,1,900,900
|459,40,150,300,67,2
|4,20,30,6000""".stripMargin.lines.toList
println(p("Input:"))
G.map{x=>println(x)}
println(p("Output: 70 bytes"))
for{l<-G;r=l.split(",");x=(r++r).slice(4,6).mkString(",")}{println(x)}
println(p("Output: 68 bytes credit: ",a(href:= "http://codegolf.stackexchange.com/questions/50381/quickgolf-ignore-the-noise-1/50403?noredirect=1#comment119138_50403", "MrBones")))
G.map(_.split(",")).map(x=>println((x++x).slice(4,6).mkString(",")))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment