public Code compare(Code code) {
		Code result = new Code(false);
		
		//check correctly placed colours.
		for(int i = 0; i < colours.length; i++) {
			if(code.getColour(i) == colours[i]) {
				result.setNextColour(Main.RED);
			}
		}
		
		//check if colour exists in code.
		for(int i = 0; i < colours.length; i++) {
			for(int j = 0; j < colours.length; j++) {
				if(i != j && code.getColour(i) == colours[j]) {
					result.setNextColour(Main.WHITE);
				}
			}
		}
		
		return result;
	}