|Programming Project 2|
For this function, you will simply be performing the following calculations and storing each value in a string:
Your function should find all the neighbors of the tile
If the board provided is invalid, (i.e. its width is not a natural number), your function should return a string of
Although your function above will work in cases where the
The second function you will write for this project is called
getNeighborLabelsand one test case of
verifyNeighbor. Each test case is two lines long: the first line contains a double quote, followed by the name of the function, followed by a space, followed by all of the arguments to the function, each separated by a single space, followed by a double quote, followed by a comma, and terminated by a newline. Then, on the next line, you should provide the expected answer for that function call, followed by a comma, and terminated by a newline. In your tests, make sure you include spaces where they need to be, otherwise they will not pass on Marmoset.
driver.pyfile that will use your
DriverJava.javafile and print out whether or not the tests you wrote passed or failed. To use this driver, make sure your
driver.pyare all in the same directory, and from a terminal in that directory, type:
project2.py(and remember the link to the template for this file above).
DriverJava.javaabove: these tests are the Public Tests on Marmoset.
is not, numeric comparison operators (<,>,<=,>=), and the
abs(x)function useful for this project. You will also have to use if-else statements. You will need the
returnstatement to get your functions to return a value.
DriverJava.javafile on Marmoset following the link to CS112-2T. (The T stands for TEST)
project2.py. Normally, Marmoset is set up to work with Java files, which is why we have this workaround. Submit ONLY your
SystemCall.javafiles on Marmoset following the link to CS112-2C. (the C stands for CODE). Find the link on Marmoset to submit Project 2. Once you pass all the public tests, use your tokens wisely to start examining the release tests. Do not change the name of the files.