Skip to content

Instantly share code, notes, and snippets.

@HDBandit
Created August 17, 2016 20:46
Show Gist options
  • Save HDBandit/7ee11ff422081ba96b393b90beb846ac to your computer and use it in GitHub Desktop.
Save HDBandit/7ee11ff422081ba96b393b90beb846ac to your computer and use it in GitHub Desktop.
import Robot._
import Speed._
object RobotApp {
def main(args: Array[String]): Unit = {
// scala style
val robot = newRobot(0, 0)
robot at 30.km_hour towards (20, 15) go
robot at 60.km_hour towards (60, 15) go
robot at 2.meters_second towards (22, 17) go
// java style
/*
Robot robot = Robot.newRobot(0, 0);
robot.at(new Speed(30).km_hour()).towards(20, 20).go();
*/
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment