Code Monkey home page Code Monkey logo

assassin-admin's Introduction

Assassin Admin

This program manages a game of Assassin by creating a list of alive assassins with a given file a names. The class performs tasks and moves killed assassins into a dead list until a single alive assassin emerges as the winner.

Public Methods

pre : names must be a non-empty List of Strings (throws IllegalArgumentException if not)

post: constructs an AssassinAdmin object with a kill ring list with, and in the same order as, the given file of names

public AssassinAdmin(List<String> names)

post: prints the names of the people in the kill ring and who they are stalking. If there is only one person, it reports that they are stalking themselves.

void printKillRing()(Scanner input)

post: prints the names of dead people & their killer in the graveyard. Reported in reverse kill order, meaning the most recently killed is printed first. If graveyard is empty no output is produced.

void printGraveyard()

post: returns true if given name is currently in the kill ring. False otherwise. Method is case insensitive

boolean killRingContains(String name)

post: returns true if given name is currently in the graveyard. False otherwise. Method is case insensitive

boolean graveyardContains(String name)

post: returns true if given name is currently in the given list. False otherwise. Method is case insensitive

boolean contains(AssassinNode list, String name)

post: returns true if there is only one player in the kill ring. False otherwise.

boolean gameOver()

post: returns name of winner if game is over. Otherwise, returns null

String winner()

pre : Kill ring contains given name (throws IllegalArgumentException if not). Game is not over (throws IllegalStateException if is)

post: moves player with given name from the kill ring to the graveyard. Method is case insensitive

void kill(String name)

assassin-admin's People

Contributors

chrisg220 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.