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 SafeFizzBuzz extends scalaz.effect.SafeApp { | |
import scalaz._ | |
import scalaz.effect._ | |
import scalaz.std.string._ | |
override def run(args: ImmutableArray[String]): IO[Unit] = { | |
def int2answer(i: Int) = | |
if (i % 3 == 0 && i % 5 == 0) Some("fizzbuzz") | |
else if (i % 3 == 0) Some("fizz") | |
else if (i % 5 == 0) Some("buzz") |
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
package app.models.game.world | |
import java.util.UUID | |
import app.models.game._ | |
import app.models.game.world.buildings._ | |
import app.models.game.world.props.{ExtractionSpeed, AsteroidImpl, PropImpl} | |
import app.models.game.world.units._ | |
import utils.IdObj |
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
import sbt.Keys._ | |
name := "TBS Game" | |
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/" | |
resolvers += Resolver.sonatypeRepo("releases") | |
resolvers += Resolver.sonatypeRepo("snapshots") |
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
def moveAttack[A <: MovableFighter]( | |
world: World, unit: A, | |
target: SearchRes[OwnedObj], strict: Boolean=true | |
)(implicit ev: A#Self =:= A): Result[A] = { | |
moveAndThen(world, unit, target.path, strict) { case (newWorld, movedUnit) => | |
movedUnit.attackWS(target.value, newWorld).right.map(_.map { | |
case (w, u) => (w, u) | |
}) | |
} | |
} |
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
#!/usr/bin/env ruby | |
$tracks = [] | |
class Track | |
attr_accessor :no, :hours, :minutes, :seconds, :performer, :song_name | |
def initialize(no, hours, minutes, seconds, title) | |
@no, @hours, @minutes, @seconds = no, hours, minutes, seconds | |
split_title = title.split("-", 2) |
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
#!/usr/bin/env ruby | |
$tracks = [] | |
class Track | |
attr_accessor :no, :hours, :minutes, :seconds, :performer, :song_name | |
def initialize(no, hours, minutes, seconds, title) | |
@no, @hours, @minutes, @seconds = no, hours, minutes, seconds | |
split_title = title.split("-", 2) |
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
private void readFrame( | |
byte[] buffer, int frameLength, int leftToRead, Ref<bool> continueReading, | |
Act<Try<Messages.Messages.FromServer>> callback | |
) { | |
Log.debug(string.Format( | |
"Entering #readFrame(frameLength={0}, leftToRead={1})", frameLength, leftToRead | |
)); | |
var stream = tcp.GetStream(); | |
stream.BeginRead(buffer, frameLength - leftToRead, leftToRead, ar => { | |
var bytesRead = stream.EndRead(ar); |
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
{ | |
games: [ | |
{ | |
"title": "Orborun", | |
"description": "Orborun is a 3D run & roll game where your nerves will be put to the test.", | |
"youtube_key": "YnVI9AVWx5U", | |
"start_at_s": 50, | |
"platforms": ["ios", "android", "windows", "osx", "linux", "wp8"], | |
"links": { | |
"google-play": "https://play.google.com/store/apps/details?id=com.bulkypix.orborun", |
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
package utils.actors | |
import akka.actor.{ActorLogging, Actor, ActorRef} | |
import akka.util.ByteString | |
import scala.reflect.ClassTag | |
object CodedFrameProxy { | |
case class Init(intFramedProxy: ActorRef, decodedMessageHandler: ActorRef) | |
} |
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
package app.models.world | |
import java.util.UUID | |
import shapeless._ | |
import shapeless.ops.record.Selector | |
import shapeless.record._ | |
case class Vect2(x: Int, y: Int) | |
case class Bounds(position: Vect2, size: Vect2) |