{"id":292,"date":"2011-09-25T18:38:04","date_gmt":"2011-09-26T01:38:04","guid":{"rendered":"http:\/\/blogs.unsw.edu.au\/comp1400\/?p=292"},"modified":"2011-09-27T20:21:46","modified_gmt":"2011-09-28T03:21:46","slug":"assignment-3-uno","status":"publish","type":"post","link":"https:\/\/blogs.unsw.edu.au\/comp1400\/blog\/2011\/09\/assignment-3-uno\/","title":{"rendered":"Assignment 3 &#8211; Uno"},"content":{"rendered":"<h3>Due Date: Sunday week 12 (23:59:59 16 October 2011)<\/h3>\n<p>Your final assignment is to complete an implementation of the game of <a href=\"http:\/\/www.unorules.com\/\">Uno<\/a>. The focus of the assignment is on using <strong>inheritance<\/strong>. You will also be required to write <strong>unit tests<\/strong> for you code to demonstrate its correctness.<\/p>\n<p><!--more--><\/p>\n<h1>Background<\/h1>\n<p>To start the project, download the BlueJ package for <a href=\"http:\/\/www.cse.unsw.edu.au\/~cs1400\/assignments\/ass3.zip\">Assignment 3<\/a>. In it you will find three classes:<\/p>\n<ul>\n<li><strong>UnoGame<\/strong> &#8211; This class implements the rules of the game.<\/li>\n<li><strong>Player<\/strong> &#8211; This class implements a fairly stupid AI player.<\/li>\n<li><strong>Card<\/strong> &#8211; This class implements a standard number card.<\/li>\n<\/ul>\n<p>You should <strong>NOT<\/strong> change the source of any of these classes. <\/p>\n<p>Your job is to create five new classes, all extensions of the Card class:<\/p>\n<ol>\n<li><strong>DrawCard<\/strong> &#8211; This card causes the next player to draw a number of cards (designated in the constructor) and miss their turn.<\/li>\n<li><strong>SkipCard<\/strong> &#8211; This card causes the next <em>n<\/em> players to miss their turn (for a number <em>n<\/em> designated in the constructor)<\/li>\n<li><strong>ReverseCard<\/strong> &#8211; This card causes the direction of play to reverse.<\/li>\n<li><strong>WildCard<\/strong> &#8211; This card can be played at on any other card. It changes the colour randomly.<\/li>\n<li><strong>WildDrawCard<\/strong> &#8211; A combination of the Wild and Draw cards.<\/li>\n<\/ol>\n<h3>The rules of Uno<\/h3>\n<p>You can read the rules of Uno <a href=\"http:\/\/www.unorules.com\/\">here<\/a>. The existing code already implements these rules for standard numbered cards, you just have to extend it to the cards above. Note in particular that Draw, Skip and Reverse cards all have a colour like normal number cards, and can only be played on cards of the same colour or on another Draw, Skip or Reverse (respectively). Wild cards, on the other hand, do not have a colour and can be played on any other card.<\/p>\n<p>For this assignment we are implementing a game with no human players, so you do not need to worry about how to handle input. For this reason, we will assume the Wild cards change the colour randomly.<\/p>\n<h3>Constructors and Methods<\/h3>\n<p>Your classes shoud have the following constructors:<\/p>\n<ul>\n<li><code>SkipCard(int colour, int nSkip)<\/code> Create a skip card with the given <em>colour<\/em> that skips <em>nSkip<\/em> players.<\/li>\n<li><code>ReverseCard(int colour)<\/code> Create a reverse card with the given <em>colour<\/em>.<\/li>\n<li><code>DrawCard(int colour, int nDraw)<\/code> Create a draw card with the given <em>colour<\/em> which makes the next player draw <em>nDraw<\/em> cards.<\/li>\n<li><code>WildCard()<\/code> Create a wild card (no colour specified).<\/li>\n<li><code>WildDrawCard(int nDraw)<\/code> Create a wild card (no colour specified) that causes the next player to draw <em>nDraw<\/em> cards.<\/li>\n<\/ul>\n<p>Your classes should override the <code>canPlayOn<\/code> and <code>play<\/code> methods in Card as necessary in order to implement their functionality.<\/p>\n<h3>Unit testing<\/h3>\n<p>Each of the classes provided in the assignment have associated unit tests. You are required to implement further unit tests for the classes you have created, demonstrating that they work as required. Your unit test classes should be named:<\/p>\n<ol>\n<li>SkipCardTest<\/li>\n<li>ReverseCardTest<\/li>\n<li>DrawCardTest<\/li>\n<li>WildCardTest<\/li>\n<li>WildDrawCardTest<\/li>\n<\/ol>\n<p>Do <strong>not<\/strong> change any of the existing test classes.<\/p>\n<h1>Marking<\/h1>\n<p>Your mark will be based 50% on the <strong>correctness<\/strong> of you code, 30% on <strong>testing<\/strong> and 20% on <strong>style<\/strong>.<\/p>\n<p>If the assignment is submitted late, 10% will be taken off the maximum make per day, to a maximum of 7 days.<\/p>\n<h1>Submission<\/h1>\n<p>You will be submitting your solutions online, by the following steps:<\/p>\n<ol>\n<li>Select &#8220;<strong>Create Jar File&#8230;<\/strong>&#8221; In the Project menu in BlueJ.<\/li>\n<li>In the dialog box make sure the &#8220;<strong>Include source<\/strong>&#8221;  box is checked.<\/li>\n<li>Press <strong>Continue<\/strong><\/li>\n<li>Save with the filename &#8220;<strong>ass3.jar<\/strong>&#8220;<\/li>\n<li>Go to <a href=\"https:\/\/cgi.cse.unsw.edu.au\/~give\/Student\/give.php\">https:\/\/cgi.cse.unsw.edu.au\/~give\/Student\/give.php<\/a><\/li>\n<li>Login with your <strong>CSE username<\/strong> and password<\/li>\n<li>Type <strong>COMP1400<\/strong> in the Course field and press Search<\/li>\n<li>Select <strong>ass3<\/strong> from the list of assignments and press <strong>Upload my assignment<\/strong><\/li>\n<li>Select <strong>Browse<\/strong> to locate your <strong>ass3.jar<\/strong> file.<\/li>\n<li>Press <strong>Submit my files<\/strong>.<\/li>\n<li>Check the response to make sure your submission was processed correctly.<\/li>\n<\/ol>\n<p><strong>NOTE:<\/strong> You can submit as often as you like. Only the last submission will be marked. <strong>Do NOT leave it to the last minute<\/strong>. No sympathy will be given if you leave submission until midnight Sunday and something goes wrong. It is good practice to make multiple submissions as you go.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Due Date: Sunday week 12 (23:59:59 16 October 2011) Your final assignment is to complete an implementation of the game of Uno. The focus of the assignment is on using inheritance. You will also be required to write unit tests for you code to demonstrate its correctness.<\/p>\n","protected":false},"author":80,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[468],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-assignments"],"_links":{"self":[{"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/users\/80"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/comments?post=292"}],"version-history":[{"count":12,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/posts\/292\/revisions"}],"predecessor-version":[{"id":304,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/posts\/292\/revisions\/304"}],"wp:attachment":[{"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/media?parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/categories?post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.unsw.edu.au\/comp1400\/wp-json\/wp\/v2\/tags?post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}