Created
August 17, 2016 20:46
-
-
Save HDBandit/7ee11ff422081ba96b393b90beb846ac to your computer and use it in GitHub Desktop.
This file contains 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 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