Assignment 1. Due: 2:00pm, Monday 14th November 2016 This assignment counts for 25% of your final grade.

Similar documents
CS Project 1 Fall 2017

CS Programming Project 1

Project 1: A Game of Greed

Begin this assignment by first creating a new Java Project called Assignment 5.There is only one part to this assignment.

Programming Assignment 4

HW4: The Game of Pig Due date: Thursday, Oct. 29 th at 9pm. Late turn-in deadline is Tuesday, Nov. 3 rd at 9pm.

Homework 5 Due April 28, 2017

SEEM3460/ESTR3504 (2017) Project

CPSC 217 Assignment 3 Due Date: Friday March 30, 2018 at 11:59pm

To use one-dimensional arrays and implement a collection class.

Homework Assignment #2

Final Project Due August 4, 2017

HW4: The Game of Pig Due date: Tuesday, Mar 15 th at 9pm. Late turn-in deadline is Thursday, Mar 17th at 9pm.

Assignment II: Set. Objective. Materials

CIDM 2315 Final Project: Hunt the Wumpus

G51PGP: Software Paradigms. Object Oriented Coursework 4

Problem Set 4: Video Poker

Requirements Specification

ECE2049: Foundations of Embedded Systems Lab Exercise #1 C Term 2018 Implementing a Black Jack game

Introduction to Computers and Engineering Problem Solving Spring 2012 Problem Set 10: Electrical Circuits Due: 12 noon, Friday May 11, 2012

Lab Assignment 3. Writing a text-based adventure. February 23, 2010

Assignment 6 Play A Game: Minesweeper or Battleship!!! Due: Sunday, December 3rd, :59pm

Activity 6: Playing Elevens

CS 152 Computer Programming Fundamentals Lab 8: Klondike Solitaire

CS 540-2: Introduction to Artificial Intelligence Homework Assignment #2. Assigned: Monday, February 6 Due: Saturday, February 18

Taffy Tangle. cpsc 231 assignment #5. Due Dates

Introduction to Artificial Intelligence CS 151 Programming Assignment 2 Mancala!! Due (in dropbox) Tuesday, September 23, 9:34am

Lab Exercise #10. Assignment Overview

Risk. CSc 335 Final Project

Final Project: Reversi

Training a Neural Network for Checkers

Intro to Java Programming Project

CS 51 Homework Laboratory # 7

CPSC 217 Assignment 3

CS 371M. Homework 2: Risk. All submissions should be done via git. Refer to the git setup, and submission documents for the correct procedure.

DELIVERABLES. This assignment is worth 50 points and is due on the crashwhite.polytechnic.org server at 23:59:59 on the date given in class.

For slightly more detailed instructions on how to play, visit:

CS221 Project Final Report Automatic Flappy Bird Player

CSSE220 BomberMan programming assignment Team Project

For more information on how you can download and purchase Clickteam Fusion 2.5, check out the website

Programming Project 2

Week 1 Assignment Word Search

INTRODUCTION OBJECT OF THE GAME. Classic Bingo. Pattern Bingo

CS 251 Intermediate Programming Space Invaders Project: Part 3 Complete Game

Bridge Players: 4 Type: Trick-Taking Card rank: A K Q J Suit rank: NT (No Trumps) > (Spades) > (Hearts) > (Diamonds) > (Clubs)

Assignment III: Graphical Set

ENGLIT 0522 INTERACTIVE FICTION AS LITERATURE. Dr. Patrick Scott Belk, Biddle Hall 225, Office Hours: 10:00 AM-12:20 PM TTh,

This course involves writing and revising a research paper on a topic of your choice, and helping other students with their research papers.

CSE231 Spring Updated 04/09/2019 Project 10: Basra - A Fishing Card Game

Distributed Slap Jack

Sudoku Online Qualifiers2017

Neon Genesis Evangelion The Card Game. Official Rule Book - Version 2.0 English Edition

Adversary Search. Ref: Chapter 5

For this assignment, your job is to create a program that plays (a simplified version of) blackjack. Name your program blackjack.py.

Programming Languages and Techniques Homework 3

ProgrammingAssignment #7: Let s Play Blackjack!

PLAY & WIN!* SUPER RUGBY 2018 DOWNLOAD THE APP TODAY! See inside for more information. *Terms and conditions apply. Metalcraft Insulated Panel Systems

Global Game Jam Accessibility Challenge

Embedded Systems Lab

Submitting Your Manuscript to ScholarOne Manuscripts: A Guide. To submit your manuscript, you will need the following files:

Name: Probability, Part 1 March 4, 2013

Identify Discover Achieve

Introduction to Computing 2014 Assignment 4 (Preliminary Version) Simple Checkers Game

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

CS151 - Assignment 2 Mancala Due: Tuesday March 5 at the beginning of class

How to write the perfect short story >>>CLICK HERE<<<

STEPS TO REGISTER YOUR CHAPTER FOR 2018 FBLA STATE LEADERSHIP CONFERENCE (SLC)

BIEB 143 Spring 2018 Weeks 8-10 Game Theory Lab

2359 (i.e. 11:59:00 pm) on 4/16/18 via Blackboard

Inheritance Inheritance

Transcript of the podcasted interview: How to negotiate with your boss by W.P. Carey School of Business

This game can be played in a 3x3 grid (shown in the figure 2.1).The game can be played by two players. There are two options for players:

CS1301 Individual Homework 5 Olympics Due Monday March 7 th, 2016 before 11:55pm Out of 100 Points

Assignment 5: Virtual Reality Design

Training Neural Networks for Checkers

COMP 9 Lab 3: Blackjack revisited

Official Tournament Guidelines Version 1.1 October 25, 2005

CMPT 310 Assignment 1

Assignment 5: Yahtzee! TM

Unit 12: Artificial Intelligence CS 101, Fall 2018

You Can Make a Difference! Due November 11/12 (Implementation plans due in class on 11/9)

CSC242 Intro to AI Spring 2012 Project 2: Knowledge and Reasoning Handed out: Thu Mar 1 Due: Wed Mar 21 11:59pm

COMPONENTS. The Dreamworld board. The Dreamshards and their shardbag

Level 2 Create software components using Java (7266/ )

Self Learning Game Software Requirements Specification Joint Document Version 1

CS 211 Project 2 Assignment

CONTENTS. 1. Number of Players. 2. General. 3. Ending the Game. FF-TCG Comprehensive Rules ver.1.0 Last Update: 22/11/2017

Games for Drill and Practice

Animal Poker Rulebook

Competition Handbook

1 Introduction. 2 Background and Review Literature. Object-oriented programming (or OOP) is a design and coding technique

Lazy Money Method. With Methods Like These, Why are You Broke?

Blogging Goals. Challenge

CS 1410 Final Project: TRON-41

Comp th February Due: 11:59pm, 25th February 2014

Probability Paradoxes

GET OVERLAPPED! Author: Huang Yi. Forum thread:

CS61B, Fall 2014 Project #2: Jumping Cubes(version 3) P. N. Hilfinger

Lab 11: GoFirst and Nim 12:00 PM, Nov 19, 2017

Assignment 3: Fortress Defense

Transcription:

Assignment 1 Due: 2:00pm, Monday 14th November 2016 This assignment counts for 25% of your final grade. For this assignment you are being asked to design, implement and document a simple card game in the Java programming language. You are advised that in order to accomplish this assignment correctly you should use the techniques regarding class structure, object usage and data structures that have been taught to you during the lectures. The first round of the game starts with all players having the same number of cards in their deck, and the cards are facing down (i.e. not visible to the players); all cards have a number of attributes, each attribute having a value from 0 up to 9 (inclusive). Every player picks up a card from the top of his/her deck and looks at it. The nominated first player then chooses an attribute, say Attribute i, to play with ; all the players compare the values of this Attribute i on the cards they have picked up. The player with the highest value wins the round, collects the cards that the other players had picked up and puts them (together with his/her card) facing down at the bottom of his/her deck. The next round starts with every player picking up the card on top of his/her deck and looking at it, and the winner of the previous round choosing the attribute they wish to play with. The game continues in the same fashion for an unlimited number of rounds until only one player, the winner, has cards left in their deck. BACKGROUND: THE CARD GAME CardGame is intended to be an application that simulates the above described card game with the following features:

In the simplest form, there is one human player (the user of the application) and one computer player. The user is prompted to enter his/her name. After entering their name, the user is then prompted to select the type of computer player they wish to play against. The options are: a predictable computer, i.e., one that always chooses the same attribute in every round in which they play first, or a random computer, i.e., one that randomly (uniformly at random) chooses one of the available attributes in every round in which they play first. After the players have been initialized, the game starts and the screen shows the names of the players and the number of cards in each player s deck. Then, the name of the player who plays first in the current round (i.e., current player) is shown on the screen, followed by the card at the top of their deck. If the current player is human, then there is a prompt on the screen for them to choose which attribute they wish to play with on the current round. After the attribute is selected, the winner is declared and shown on the screen, and the game moves on to the next round. Note: if you have ties in a round, simply choose as the winner the player who is closest to the first player that was entered in the game. This continues until there is only one player left with cards in their deck, and all other players have 0 cards. TO DO Implement the CardGame functionality in Java (Needed for a pass): Implement the card game outlined above; using objects and good class structure, create objects for the card, attribute player, game and of course the main class/method. IMPORTANT: It is not necessary for this game to include any graphical output in the form of a GUI. The only output required is to the console/terminal as this is intended to be a text based game. Card Class: This class should hold the attributes and any other properties of a card in the deck.

Attribute Class: This class should hold the name and value of the attribute; having it as a class will allow you to dynamically create as many attributes as you want for the cards in a deck. This could be useful if for example you wanted to give your user a choice of decks to play with, Bands or Cars for example, where the number of attributes that a card in each deck has might differ (e.g., for a Band you might want to have attributes such as popularity, whereas for Cars you might want to have attributes such as speed or price ). Player Class: This class should make the correct use of collections to hold a player s deck. It will also contain information about the player, for example the type of the player (human or computer). It might be useful to also have methods in this class that can perform operations on any collections it might make use of, for example adding or removing cards from the player s deck. Extension of Classes: You should create classes that extend some of the ones above where appropriate. For example, you could extend the player class to create classes specifically for a human player or different types of computer players. Game Class: You should create a class that initialises the game and contains all of the logic for the game itself. Main Class: You should have a Main Class with a Main Method that will instantiate the game. It is good practice to have nothing else present here as it allows you to create attributes and functions that are not static and therefore allow for the correct use of multiple instances. Must make use of: Data Structures, e.g. Queues Custom Objects, e.g. Card Object Inheritance, e.g., HumanPlayer class extends Player class. Take human input from the keyboard. Document your Java Implementation (Needed for a pass): Each class, method, field and constructor in your Java implementation should have a javadoc comment, even if its scope is private. You should use @param and @return tags where appropriate.

MORE BONUS CONTENT FOR A REALLY ADVANCED GAME (Needed for > 80%) You can allow the game to have multiple human and multiple computer players. You can set up some intelligence to the computer player(s): A Smart Computer will be able to select the highest valued attribute on their card if it was their turn to select an attribute first. A Predictable Computer will always select, say, the 1 st attribute on their card if it was their turn to select an attribute first. Submission In this case, you should print a command on the console to ask the user what type they want each computer player to be, i.e., random, smart or predictable. You should submit files, as described below, through the departmental on-line submission system (click here). Please do not zip or archive your files; upload them separately, and make sure the names of the files are the same as those given below. Please also do not include package declarations in your Java files. 1. A file, Attribute.java, containing your Java implementation for the card attributes. 2. A file, Card.java, containing your Java implementation for the cards of the game. 3. A file, Player.java, containing your Java implementation for the players of the game. 4. A file, Human.java, containing your Java implementation for the human player(s) of the game. 5. A file, RandomComputer.java, containing your Java implementation for the random computer player type. 6. A file, Game.java, containing your Java implementation for the game simulation. 7. A file, Main.java, containing your main method (this should only be a very small piece of code that creates a new object of type Game and invokes the method that runs the game). 8. If you have any other.java files, please also upload them; however, if you follow the description outlined above, you shouldn t need more than the 7.java files described in this list (You may have more if you deliver the bonus content). All files should have complete Javadoc comments.

MARKING This assignment contributes 25% of your final grade for this module, and will be marked according to how far the following requirements are met: The Java code should be laid out according to a consistent format, and it should contain clear comments The Java code should correctly implement the functionality set out above. The javadoc documentation should be full (one document comment for each class and each method of each class), clear and informative. A first-class solution (70+%) will meet all these requirements fully; a 2.I solution (60-69%) will meet most but perhaps not all of these requirements (e.g., the code may not quite implement all the desired functionality, or may lack comments, or have an untidy layout); a 2.II solution (50-59%) will have some more serious faults (e.g., the code may fall some way short of all the desired functionality, or may contain syntactic errors); a third-class (40-49%) solution will have serious faults, though it should still show that a decent attempt was made (e.g., code that falls further short of being functional - though it still shouldn't be too far away). A solution getting a failing grade will simply be bad. Failure to hand in a solution will get a zero grade. It might be possible to gain a higher mark - i.e., move above the 80% threshold by showing some originality and/or creativity - by thinking about what extra functionality might usefully extend these basic requirements, but I'd recommend you think about this only if you're satisfied that the work you've done on the basic requirements is above the 70% threshold that you meet by turning in work of a very high standard. In other words, if you don't do a good job on the basic required elements, you're unlikely to improve your marks by spending effort on implementing functionality that isn't asked for. Note that "originality" and "creativity" could include very clear comments or other indications of thinking clearly about the problem; showing reading outside the lecture notes, developing a neat class hierarchy; etc. Notes Javadoc is covered in Lecture 11.