1. You are expected to write all your own code. That is, it is cheating to turn in code written by someone else. The one exception is code that has been written on the board by the professor or published on the course website. Even that code, you are expected to type in, with the exception of pre-defined arrays that are explicitly given you to save typing on some assignments, for example, arrays of examples for testing.
2. You are expected to submit code that you wrote explicitly for this class. That is, you are not allowed to re-use by copy and paste old code that you "wrote" in a previous semester, that may have been copied from the instructor's presentation in that class. In some cases you may be asked to re-use code from a specific previous assignment this semester--specifially the BigMatrix code will be reused for the Google assignment, and you can start BobTheKnight and MazePath from a copy of the Bob's Way Home code given in class.
3. In other words: you start each assignment with a blank window and you type into that window, but you can cut and paste code that you wrote this semester for this class.
4. If I can paste a paragraph of your code into Google and I can find an exact match, right down to variable names and comments, that will be considered unacceptable, even though it doesn't prove that you copied the code in question from the source Google found. There is a tree T whose nodes are pieces of Java code and where the children of a node x are pieces of code copied from x. What is proved in such a case is that your code and the match found by Google have a common ancestor in the tree T. But according to rule 3, your code is not supposed to have any ancestor at all in T, unless it's in a piece of my code, and all the code I use in this course has no ancestor in T. In such a case, you will normally not be accused of cheating, but you won't get credit for that assignment. This is not a promise that you won't be accused of cheating, but the evidence would have to be unusually strong to show the intent to cheat.
Google could possibly match a piece of my code that was copied by a former student and (legally) by you. But I'll recognize that.
Question: Isn't this policy contrary to the principle of "code re-use", which is a pillar of modern software engineering?
Answer: The assignments in this class are small projects, meant to be completed in few hours from scratch. They deal with fundamental ideas, all of which have been programmed many times. The point of such projects is to learn how to implement these ideas yourself! not how to Google up someone else's solution and re-use it. This is an algorithms class, not a software engineering class.