Assignment 3: Fortress Defense

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

CMPT 125/128 with Dr. Fraser. Assignment 3

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

User Guide. Version 1.2. Copyright Favor Software. Revised:

User Guide. Version 1.4. Copyright Favor Software. Revised:

Spring 06 Assignment 2: Constraint Satisfaction Problems

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

Spring 06 Assignment 2: Constraint Satisfaction Problems

CSSE220 BomberMan programming assignment Team Project

Mobile Application Programming: Android

CMSC 201 Fall 2018 Project 3 Sudoku

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

Mine Seeker. Software Requirements Document CMPT 276 Assignment 3 May Team I-M-Assignment by Dr. B. Fraser, Bill Nobody, Patty Noone.

CS 211 Project 2 Assignment

Battlefield Academy Template 1 Guide

Programming Project 2

Object-Oriented Design

The $2 Game. To experience negotiations in a win/lose scenario. Each player should have a pen and paper. Set of Secret Instructions for each round.

Assignment 12 CSc 210 Fall 2017 Due December 6th, 8:00 pm MST

RoboMind Challenges. Line Following. Description. Make robots navigate by itself. Make sure you have the latest software

Programming Problems 14 th Annual Computer Science Programming Contest

CIDM 2315 Final Project: Hunt the Wumpus

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

SEEM3460/ESTR3504 (2017) Project

Vector VS Pixels Introduction to Adobe Photoshop

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

Taffy Tangle. cpsc 231 assignment #5. Due Dates

World at War. Blood and Bridges, Death of First Panzer, Eisenbach Gap COMBINED SCENARIO: A RACE FOR VICTORY. Robert Holzer, 2010

Down In Flames WWI 9/7/2005

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

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

Tac Due: Sep. 26, 2012

1 The Pieces. 1.1 The Body + Bounding Box. CS 314H Data Structures Fall 2018 Programming Assignment #4 Tetris Due October 8/October 12, 2018

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

CMPT 310 Assignment 1

Final Project: Reversi

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

CPSC 217 Assignment 3

TABLE OF CONTENTS==============================================================

CMPT 310 Assignment 1

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

2D Platform. Table of Contents

Sudoku Solver Version: 2.5 Due Date: April 5 th 2013

Project 1: A Game of Greed

ENSC327/328 Communication Systems Course Information. Paul Ho Professor School of Engineering Science Simon Fraser University

(a) Left Right (b) Left Right. Up Up 5-4. Row Down 0-5 Row Down 1 2. (c) B1 B2 (d) B1 B2 A1 4, 2-5, 6 A1 3, 2 0, 1

Lab Exercise #10. Assignment Overview

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

COMPUTING CURRICULUM TOOLKIT

CSCE 2004 S19 Assignment 5. Halfway checkin: April 6, 2019, 11:59pm. Final version: Apr. 12, 2019, 11:59pm

1Getting set up to start this exercise

Homework Assignment #1

Naval Battle! Comp-361 : Naval Battle! Lecture 2. Alexandre Denault Computer Science McGill University Winter 2008

Royal Battles. A Tactical Game using playing cards and chess pieces. by Jeff Moore

2 Textual Input Language. 1.1 Notation. Project #2 2

CSci 1113, Spring 2018 Lab Exercise 13 (Week 14): Graphics part 2

G51PGP: Software Paradigms. Object Oriented Coursework 4

Submittal Exchange Design Team User Guide

Making Middle School Math Come Alive with Games and Activities

The purpose of this document is to help users create their own TimeSplitters Future Perfect maps. It is designed as a brief overview for beginners.

Computer Science 25: Introduction to C Programming

UTD Programming Contest for High School Students April 1st, 2017

Creating Journey In AgentCubes

Bible Battles Trading Card Game OFFICIAL RULES. Copyright 2009 Bible Battles Trading Card Game

Author Tutorial for OPTE Editorial Manager System

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

Clever Hangman. CompSci 101. April 16, 2013

Pennies vs Paperclips

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

Getting Started with Panzer Campaigns: Stalingrad 42

Math Contest Preparation II

15 TUBE CLEANER: A SIMPLE SHOOTING GAME

Work Instruction. Submitting a Census Roster: Dropping Students and Recording Early Alerts

isudoku Computing Solutions to Sudoku Puzzles w/ 3 Algorithms by: Gavin Hillebrand Jamie Sparrow Jonathon Makepeace Matthew Harris

1 Place value (1) Quick reference. *for NRICH activities mapped to the Cambridge Primary objectives, please visit

Wahl HSI3000 Series Imager Report Writer Software

BIEB 143 Spring 2018 Weeks 8-10 Game Theory Lab

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

Making Domino Designer work like you want

Mindful Communication In Code Reviews. By Amy Ciavolino, presenter notes are at the bottom.

Battle. Table of Contents. James W. Gray Introduction

ARMY COMMANDER - GREAT WAR INDEX

Henry Bodenstedt s Game of the Franco-Prussian War

CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Sep 25. Homework #1. ( Due: Oct 10 ) Figure 1: The laser game.

Make sure your name and FSUID are in a comment at the top of the file.

Creating a Jungle Walkway

Mathematics Alignment Lesson


Getting Started with Modern Campaigns: Danube Front 85

CS Programming Project 1

UN DOS TREZ Sudoku Competition. Puzzle Booklet for Preliminary Round. 19-Feb :45PM 75 minutes

Course Intro Essay All information for this assignment is also available online:

Sheet Metal Punch ifeatures

Lab 1. CS 5233 Fall 2007 assigned August 22, 2007 Tom Bylander, Instructor due midnight, Sept. 26, 2007

Getting Started with Panzer Campaigns: Budapest 45

Lab 1: Non-Ideal Operational Amplifier and Op-Amp Circuits

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

PROBLEM SET 2 Due: Friday, September 28. Reading: CLRS Chapter 5 & Appendix C; CLR Sections 6.1, 6.2, 6.3, & 6.6;

Project #1 Report for Color Match Game

New Sixth Sense Icon o New Image chosen that is less jarring when activated. V1.0 image will be provided as well, but will no longer be default.

Transcription:

Assignment 3: Fortress Defense Due in two parts (see course webpage for dates). Submit deliverables to CourSys. Late penalty: Phase 1 (design): 10% per calendar day (each 0 to 24 hour period past due), max 2 days late. Phase 2 (implementation): No possibility of late submission (solution posted for midterm). This assignment is expected to be completed in pairs (you may complete it individually, but that is not recommended). Doing OOD in a team setting is great practice. Do not show other pairs/students your code, do not copy code found online, and do not post questions about the assignment online. Please direct all questions to the instructor or TA via course discussion group on Piazza.com. Make public if a general question, private if it includes your code. You may use ideas you find online and from others, but your solution must be your own. See the marking guide for details on how each part will be marked. Revision History Rev 1: Initial version Rev 2: Feb 3 1. Clarified behaviour about tanks not fitting on game board. 2. Added cheat requirement, and updated format of end-of-game board display (numbering tanks). Generated Feb 5, 2018, 12:14 AM Page 1/6 Dr. Fraser

1. Game Description 1.1 Story You control a peace-loving fortress which has in front of it a large field. The field is covered in a thick fog, and your enemy has positioned siege tanks in it and is attacking you! You cannot see where they are, but you can still shots at them with your fortress' gun! 1.2 Game Details The game is played with enemy tanks located somewhere within a 10 by 10 grid of cells. Each turn, you get to fire your gun, and then the enemy fires their guns (one per tank). They start off with N tanks (set by command line argument); each tank occupies four connected cells forming a Tetromino (any randomly constructed one; different tanks may be different patterns). Once the enemy tanks are placed, they do not move (they are siege tanks, after all!). Your fortress can take 1500 points of structural damage before collapsing, at which point you lose the game. The amount of damage that a siege tank does is relative to how many undamaged cells it has: Undamaged Tank Cells 4 3 2 1 0 Damage Done 20 5 2 1 0 Note that even if the middle of a tank is damaged, it still counts as one tank, and continues damaging the fortress, as listed in the table. (These things are resilient!) You cannot see the battle field due to the think fog, but your gunner can hear when your shot hits a tank. Therefore, your gunner creates a map of where you have fired, and where you have hit an enemy tank. Each turn you can see your fortress' remaining structural strength, the battle-field map, and how much damage your fortress took during the previous turn. Generated Feb 5, 2018, 12:14 AM Page 2/6 Dr. Fraser

1.3 Game play requirements When playing the game, the following requirements must be met: Accept 0, 1, or 2 command-line arguments to main(): If no arguments are provided, default to N=5 tanks; otherwise assume the first argument is an integer and use that as the number of tanks. You need not do any error checking on the type/value of this parameter. Rev 2: An optional 2 nd argument is of cheating (i.e., marking): --cheat If present, this must the second argument after the number of tanks. Should be case insensitive. See the Cheat section later for details. The program randomly places the tanks on the field such that: no two tanks can occupy the same cell all cells of each tank are contained inside the game-board/field if not all tanks can be placed on the field, the program ends. Rev 2: The program need not backtrack on already placed tanks in order to try to place all tanks. It is fine for it to blindly place tanks (randomly) on the board and should it get to the point where another tank will not reasonably fit the exit. Each turn, the player is shown the remaining structural integrity of their fortress. Each turn, the player is shown a map of what is known about the game-board so far: ~ indicates unknown (fog) X indicates hit a tank (space) indicates a miss. The game board has the columns numbered 1, 2, The game board has the rows lettered A, B, The user enters their move in the form: <Letter><Number> For example, B5, and then enter. For each shot the user makes, the user is told if it hits or misses. If the user has already shot this cell before and it was a hit, then it is a hit again but does no additional damage to the tank. If the user has already shot this cell before and it was a miss, then it is a miss again. Each enemy shot hits the fortress and does damage. The user is shown how much damage is suffered for each enemy shot. Tanks with zero undamaged cells fire no shots. When a player wins or loses, the player is told they won/lost and the game exits. Player wins when no tank cells are left undamaged. Player loses when fortress structural strength reaches 0 (or less). Rev 2: When the game ends, player is shown the complete game-board without the fog: This display must show the location of all the tanks, and where the user missed. Each tank is displayed using a unique letter (A through E if there are 5 tanks). Optional: It may differentiate tank cells that were hit from tank cells that were not hit. For example, use lower case letters to show cell that were hit. Generated Feb 5, 2018, 12:14 AM Page 3/6 Dr. Fraser

1.4 Implementation/Design Constraints The game's OOD must be good: You must have two packages: One package for the UI related class(es); another package for the model related classes (actual game logic). Imagine that you wanted to have not only a text game, but also a web version and an Android version. You should be able to reuse the entire model (game logic) in a completely different UI. Each class is responsible for one thing. Reasonably detailed break-out of classes to handle responsibilities. Each class demonstrates correct encapsulation. Consider use of immutable classes where applicable. Respect the command/query separation guideline when appropriate. The game is to use a text interface for display, and the keyboard for input. Implementation must follow the online style guide. Specifically important are: Good class, method, field, and variable names. Correct use of named constants. Good class-level comments (comment on the purpose of each class). Clear logic. OOD Hint: When you have some complex state, it is often best to encapsulate it into an object. Consider having an object for storing the state of each cell of your game-board. Store a group of these to makeup the game board. Tetromino Hint: For creating the Tetromino shapes, an easy way to do it: a) pick a location to be the start. b) randomly add a block to that location (up, down, left, or right). c) randomly add more blocks, ensuring you don't try to add the same block a second time. This may be easier than trying to pre-program all possible shapes and rotations into your system by hand. Note you cannot just grow the tetrominos from one end because some shapes are then not possible (think of the shape on the right 1 ). 2. Tasks 2.1 Phase 1: Design Complete the following steps to create an object oriented design for this application. You should be doing this with a partner and engaging in a collaborative design process 2. 1. Use case - Create a use case for the game. Hint: it will be titled Play game. - Provide a reasonable list of steps for playing the game from the user's perspective. For example, how to recover from incorrect user input without crashing (use a Use Case variation). - This must be typed on a computer and submitted as a text or PDF file named USECASE.TXT (or.pdf). Place this file in the docs/ folder of your project (you will need to create this folder). 1 By Anypodetos, Public Domain, https://commons.wikimedia.org/w/index.php?curid=8269275 2 You are allowed to do the assignment individually; however, design is best done in a group, so you should strongly consider do this assignment in pairs and actively collaborating to create a design. Generated Feb 5, 2018, 12:14 AM Page 4/6 Dr. Fraser

2. CRC Cards - Create CRC cards to come up with an initial object oriented design. - Do not submit the actual cards, but once you have settled on a design, you must type up the information stored on the CRC cards, or take a picture of the cards. - Each card must show the class name, responsibilities, and collaborators. Submit this as a.txt,.pdf, or.jpg/.png file named CRC.TXT (or.pdf,...) 1 in the docs/ folder. If you take a picture, ensure that the text is clear, and that the image is less than one MB. 3. UML Class Diagram - Create an electronic UML class diagram for your OO design. - The diagram should not be a complete specification of the system, but rather contain enough information to express the important details of your design. - Your diagram must include the major classes, all class relationships, and some key methods or fields that explain how the classes will support their responsibilities. - You must use a computer tool to create the diagram. You may not generate the diagram directly from your Java code. Suggested UML tool: Violet UML Editor (free) or Visio. - You need not update this diagram with any later changes made during implementation. - Submit your UML diagram as a PDF or image file named CLASSDIAGRAM.PDF (or.png, or.jpg, ) in the docs/ folder. 4. Explain how our OOD will work - Pick two (2) interesting (non-trivial) actions/steps that the game must support and explain how your OOD supports this. - For example, explain how the board will be drawn, or how the user's move is handled. - Imagine that you are presenting your design to your team and convincing them it's the best design. Your explanation here could be part of how you'd show that. Discuss which classes complete portions of this action/step. - Describe this in a.txt or.pdf file named OODEXPLAINED.TXT (or.pdf) in the docs/ folder. 2.2 Phase 2: Implementation Implement the game in Java. You must start with your OOD from the Design Phase, but you may modify the design as needed. You need not update your OOD documents to reflect your final design. Source Control: If you'd like to develop using SVN, by creating a project in CourSys, it will automatically create a repository for your group. If you d like to develop using GIT, you can use SFU s GitLab: https://csil-git1.cs.surrey.sfu.ca/ (Do not use GitHub unless you keep your projects closed source; do not share your code publicly during the course). 1 In reality, you would likely not be saving the CRC cards; however, since it's worth marks, you must submit something! Generated Feb 5, 2018, 12:14 AM Page 5/6 Dr. Fraser

3. Rev 2: Cheat If the --cheat command line argument is given, then: When the game starts up the very first output from the program must be the cheat map. The cheat map is the game-board displayed with: Usual row (A-J) and column (1-10) headers.. for locations without tanks. Unique letter for each tank. Give each tank a letter, starting at A, and display that tank s letter in the cheat map. Note this display format is compatible with the end-of-game board display requirements. So, reuse the code! Optional: After the board is display, display the health of the fortress. After the cheat map is displayed the game starts normally. 4. Deliverables The design and implementation sections have separate due dates (to encourage design before implementation!). Each section must be submitted as ZIP file of your project. Submit to CourSys. 4.1 Phase 1: Design 1. docs/usecase.txt (or.pdf) 2. docs/crc.txt (or.pdf, or JPG); Keep images small! 3. docs/classdiagram.pdf (or PNG, or.jpg) 4. docs/oodexplained.txt (or.pdf) 5. Any code you've written so far is fine; it won't be marked for this phase. 4.2 Phase 2: Implementation Your project must build a JAR file. No late submissions possible for the implementation phase. Submit a ZIP file of your entire project; see course webpage for details. Include the docs/ folder as well as all your code. Please remember that all submissions will automatically be compared for unexplainable similarities. Generated Feb 5, 2018, 12:14 AM Page 6/6 Dr. Fraser