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
class MathSpec extends Specification { | |
def "maximum of two numbers"() { | |
expect: | |
Math.max(a, b) == c | |
where: | |
a | b || c | |
1 | 3 || 3 | |
7 | 4 || 4 |
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 spock.lang.* | |
class MathSpec extends Specification { | |
def "should calculate the maximum of two numbers"(int a, int b, int c) { | |
expect: | |
Math.max(a, b) == c | |
where: | |
a | b | c | |
1 | 3 | 3 |
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 spock.lang.* | |
class MathSpec extends Specification { | |
def "should calculate the maximum of two numbers"() { | |
expect: | |
Math.max(1, 3) == 3 | |
Math.max(7, 4) == 7 | |
Math.max(0, 0) == 0 | |
} | |
} |
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
class Math extends Specification { | |
def "maximum of two numbers"(int a, int b, int c) { | |
expect: | |
Math.max(a, b) == c | |
where: | |
a | b | c | |
1 | 3 | 3 | |
7 | 4 | 4 | |
0 | 0 | 0 |
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 spock.lang.Specification; | |
import com.xala3pa.Calculator | |
class calculatorSpec extends Specification { | |
def "Add 3 and 4 to get the correct result"() { | |
given: "A calculator" | |
def calculator = new Calculator() | |
when: "Add 3 and 4" |
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
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | |
*.iml | |
## Directory-based project format: | |
.idea/ | |
# if you remove the above rule, at least ignore the following: | |
# User-specific stuff: | |
# .idea/workspace.xml |
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
var Robot = function(robot) { | |
// var robot = ev.robot; | |
} | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.clone(); | |
robot.rotateCannon(360); | |
robot.turn(360) |
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
var Robot = function(robot) { | |
// var robot = ev.robot; | |
} | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.clone(); | |
robot.rotateCannon(360); | |
robot.turn(360) |
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
var Robot = function(robot) { | |
// var robot = ev.robot; | |
} | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.clone(); | |
robot.rotateCannon(360); | |
robot.turn(360) |
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
var Robot = function(robot) { | |
this.direction = 1; | |
this.found = false; | |
this.loseNum = 0; | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
if(this.found) { | |
robot.turnGunRight(15 * this.direction); |
NewerOlder