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
// | |
// Adding this test fails | |
// | |
describe('One vector: ', function () { | |
it('is moved to another position', function () { // is converted into another? | |
var x = new v(1,0,0); | |
var y = new v(1,1,0); | |
var c = x.distanceFrom(y); | |
c.should.eql(1); | |
x.moveTo(y); |
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
public class Palindrome { | |
// This method checks whether its input reads the same forwards | |
// as backwards. For example, isPalindrome("noon") should return | |
// true, but isPalindrome("night") should return false. | |
// Note that this implementation contains a deliberate bug. | |
public static boolean isPalindrome(String s) { | |
if (s.length() == 0) { |