{"id":1582,"date":"2018-04-10T18:51:53","date_gmt":"2018-04-10T18:51:53","guid":{"rendered":"https:\/\/danielschlegel.org\/wp\/?page_id=1582"},"modified":"2018-04-12T13:25:27","modified_gmt":"2018-04-12T13:25:27","slug":"assignment-6","status":"publish","type":"page","link":"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/","title":{"rendered":"Assignment 6"},"content":{"rendered":"<p>In this assignment you will implement some cheat codes in your game which will allow you to see the contents of rooms you are not currently in. To do so, you will make use of the BST which we have been writing in class. Specifically, you should:<\/p>\n<ul>\n<li>Begin with the <a href=\"https:\/\/danielschlegel.org\/wp\/teaching\/binary-search-tree-impelentation\/\">BST.java<\/a> file from class.<\/li>\n<li>Implement the <tt>Comparable<\/tt> interface in your <tt>Room<\/tt> class.<\/li>\n<li>Make your <tt>BST<\/tt> (and <tt>BSTNode<\/tt>) generic using Java Generics, as we did for our Linked List.<\/li>\n<li>Modify the <tt>BST<\/tt>\u2019s <tt>insert<\/tt> and <tt>search<\/tt> methods to use the <tt>compareTo<\/tt> method provided by the <tt>Comparable<\/tt> interface.<\/li>\n<\/ul>\n<p>At this point I recommend writing a small driver class to test your BST to ensure it works for all cases. <\/p>\n<p>You will then modify your <tt>Player<\/tt> class to accept the following commands:<\/p>\n<p><tt>cheatmode<\/tt> &#8211; enables the below two options.<br \/>\n<tt>look:[roomname]<\/tt> &#8211; prints out the contents of [roomname] by looking up the Room in the BST using the search method.<br \/>\n<tt>look:all<\/tt> &#8211; prints out the contents of all rooms, printed in alphabetical order by room name using an in-order traversal of the BST.<br \/>\n<tt>nocheatmode<\/tt> &#8211; disallows the use of the above two options.<\/p>\n<p>Note, if you used a two-step process to interact with Items, you may use that same process here to maintain consistency.<\/p>\n<p><b>Extra Credit:<\/b> You may receive up to 20% extra credit on this assignment by implementing the <tt>Iterable<\/tt> and <tt>Iterator<\/tt> interfaces on your BST in an efficient manner. This should allow walking through the data structure in order using a simple for-each style loop from outside the BST. You may not copy the contents of the BST to a different data structure &#8211; it must be done in place.<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"lead\">In this assignment you will implement some cheat codes in your game which will allow you to see the contents of rooms you are not currently in. To do so, you will make use of the BST which we have been writing in class. Specifically, you should: Begin with the BST.java file from class. Implement the Comparable interface in your&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"btn btn-warning\" href=\"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1146,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","footnotes":""},"class_list":["post-1582","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Assignment 6 - Daniel R. Schlegel<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Assignment 6 - Daniel R. Schlegel\" \/>\n<meta property=\"og:description\" content=\"In this assignment you will implement some cheat codes in your game which will allow you to see the contents of rooms you are not currently in. To do so, you will make use of the BST which we have been writing in class. Specifically, you should: Begin with the BST.java file from class. Implement the Comparable interface in your&hellip;Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/\" \/>\n<meta property=\"og:site_name\" content=\"Daniel R. Schlegel\" \/>\n<meta property=\"article:modified_time\" content=\"2018-04-12T13:25:27+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/teaching\\\/csc241-spring-2018\\\/assignment-6\\\/\",\"url\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/teaching\\\/csc241-spring-2018\\\/assignment-6\\\/\",\"name\":\"Assignment 6 - Daniel R. Schlegel\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/#website\"},\"datePublished\":\"2018-04-10T18:51:53+00:00\",\"dateModified\":\"2018-04-12T13:25:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/teaching\\\/csc241-spring-2018\\\/assignment-6\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/teaching\\\/csc241-spring-2018\\\/assignment-6\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/teaching\\\/csc241-spring-2018\\\/assignment-6\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Teaching\",\"item\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/teaching\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CSC241 &#8211; Spring 2018\",\"item\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/teaching\\\/csc241-spring-2018\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Assignment 6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/#website\",\"url\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/\",\"name\":\"Daniel R. Schlegel\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/danielschlegel.org\\\/wp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Assignment 6 - Daniel R. Schlegel","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/","og_locale":"en_US","og_type":"article","og_title":"Assignment 6 - Daniel R. Schlegel","og_description":"In this assignment you will implement some cheat codes in your game which will allow you to see the contents of rooms you are not currently in. To do so, you will make use of the BST which we have been writing in class. Specifically, you should: Begin with the BST.java file from class. Implement the Comparable interface in your&hellip;Read more","og_url":"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/","og_site_name":"Daniel R. Schlegel","article_modified_time":"2018-04-12T13:25:27+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/","url":"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/","name":"Assignment 6 - Daniel R. Schlegel","isPartOf":{"@id":"https:\/\/danielschlegel.org\/wp\/#website"},"datePublished":"2018-04-10T18:51:53+00:00","dateModified":"2018-04-12T13:25:27+00:00","breadcrumb":{"@id":"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/assignment-6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/danielschlegel.org\/wp\/"},{"@type":"ListItem","position":2,"name":"Teaching","item":"https:\/\/danielschlegel.org\/wp\/teaching\/"},{"@type":"ListItem","position":3,"name":"CSC241 &#8211; Spring 2018","item":"https:\/\/danielschlegel.org\/wp\/teaching\/csc241-spring-2018\/"},{"@type":"ListItem","position":4,"name":"Assignment 6"}]},{"@type":"WebSite","@id":"https:\/\/danielschlegel.org\/wp\/#website","url":"https:\/\/danielschlegel.org\/wp\/","name":"Daniel R. Schlegel","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/danielschlegel.org\/wp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P83Tb6-pw","_links":{"self":[{"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/pages\/1582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/comments?post=1582"}],"version-history":[{"count":8,"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/pages\/1582\/revisions"}],"predecessor-version":[{"id":1595,"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/pages\/1582\/revisions\/1595"}],"up":[{"embeddable":true,"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/pages\/1146"}],"wp:attachment":[{"href":"https:\/\/danielschlegel.org\/wp\/wp-json\/wp\/v2\/media?parent=1582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}