Please make sure you are familiar with the resources and policies outlined in the syllabus and the take-home assessments page.
A3 - Assassin Manager
Initial Submission by Thursday 10/21 at 11:59 pm.
Specification Intro Video Submit Code and ReflectionYou may submit any part of the assignment as many times as you want before the initial submission. To submit on EdStem, you should use the Mark button to submit your code. You can view your past submissions using the “Submissions” button.
Please make sure you are familiar with the resubmission and late work policy on the syllabus
Developing at Home¶
You are welcome to use Ed as your environment to work on the homework, but we recommend setting up a local environment following our Desktop Software instructions. This will allow you to work offline, and access the great debugger provided by jGrasp! You can download the code from Ed and when you want to submit, upload it again and then pressing Mark to submit.
Useful Resources¶
- CSE 143 Code Quality Guide
- CSE 143 Commenting Guide
- Output Comparison Tool can help you identify differences with your program’s output and the expected output.
- jGrasp Debugging Tutorial
Frequently Asked Questions (FAQ)¶
Q: How do I get the nodes out of the list I am passed in my constructor? How do I put AssassinNode
into a linked list?
A: You do not have to and should not be trying to do either of these things. The list of String
objects you are passed is just a way of giving you the names in a specific order. You need to access those names (not the nodes) and convert them into a chain of AssassinNode
objects that represent the state of the game (who is stalking whom). The structures you make will look like “lists-that-are-linked”, that is, they are lists comprised of nodes (AssassinNode
) that are connected via next links, but they are not LinkedList
objects (the Java collection). The assignment write-up states : “You may not construct any arrays, ArrayList
s, stacks, queues, sets, maps, or other data structures to solve this problem.”
Q: How does an AssassinNode
work?
A: The AssassinNode
is just a structure that keeps track of two pieces of data (name and killer) and a link to another node. As all of its fields are public, you have access to them as you are writing your AssassinManager
code and should modify them as is necessary to implement the behavior specified by the write-up
Q: How many AssassinNode objects can I use? It doesn’t seem like I have enough variables to manipulate the lists.
A: The number of objects you may actually instantiate is the same as the number of names passed in you constructor. This means that you may only call new AssassinNode
once for each name you are given. It does not mean that you cannot create temporary variables to point to these nodes (such as you do with current when traversing a list). You may use as many temporary variables as is required to manipulate the lists.
Q: How do I kill the first/last person?
A: Part of the problem you have to solve is recognizing the different cases of the list. Dealing with certain nodes is going to prove more difficult than dealing with others, it is up to you to recognize those cases and implement behavior specific to them.
Q: Can I use a circular list instead of a null-terminating list?
A: You may, but this is often a much more difficult route. If you are having difficulty conceptualizing the use of a circular list or producing the correct behavior, you should try using a null-terminating list instead.
Q: My program says “file not found: names.txt” when I try to run it in Eclipse.
A: Put your input files in your project’s root folder, not its src/ subfolder.