MoonlightOwl

BuMP Gold! v.1

Sep 3rd, 2016
162
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.nio.file.{Files,Paths};import java.nio.{ByteBuffer,ByteOrder};object B extends App{def w(a:Array[Byte],o:Int)=ByteBuffer.wrap(a,o,4).order(ByteOrder.LITTLE_ENDIAN).getInt;val a=Files.readAllBytes(Paths.get(args(0)));val f=w(a,10);val r=w(a,18);println((for(i<-f until a.length by r*4)yield a.slice(i,i+r*4).map(_&0xFF).grouped(4).foldLeft("")((q,v)=>q+((v(0),v(1),v(2),v(3))match{case(_,_,_,a)if a<=0=>" ";case(r,g,b,_)if r<51&&g<51&&b<51=>"█";case(r,g,b,_)if r<102&&g<102&&b<102=>"▓";case(r,g,b,_)if r<154&&g<154&&b<154=>"▒";case(r,g,b,_)if r<205&&g<205&&b<205=>"░";case _=>"·";}))).reverse.mkString("\n"))}
RAW Paste Data