Code Monkey home page Code Monkey logo

2aa4-tennis's Introduction

Tennis Counting Dojo

build status

Problem Description

This problem is a classical Coding Dojo: Tennis Coding Dojo. The objective is to implement a scoring system for a simplified version of tennis.

The scoring system is rather simple:

  1. Each player can have either of these points in one game: love, 15, 30, 40.
  2. If you have 40 and you win the point you win the game, however there are special rules.
  3. If both have 40 the players are deuce.
  4. If the game is in deuce, the winner of a point will have advantage
  5. If the player with advantage wins the ball they win the game
  6. If the player without advantage wins they are back at deuce.

Assumptions

The problem description is vague and imprecise, and does not indicate how the score is actually incremented. We'll operate under the following assumptions:

  • Players are characterized by a strength (a simplification of their ATP ranking)
  • The strength is an integer in the [0,100] range
  • This number is provided to the counting assistant through the command line (default is 50)

How to use this software?

To compile the source code into a turn-key Java ARchive (JAR):

mosser@azrael 2aa4-tennis % mvn package  

To run the counting assistant:

mosser@azrael 2aa4-tennis % java -jar target/tennis.jar -p1 75 -p2 30
** Starting Tennis Counter Assistant
**** Reading Command-Line Arguments
****** P1's Strength is 75/100
****** P2's Strength is 30/100
**** Starting game
** TODO...
** Closing Tennis Counter Assistant

Usage in 2AA4 @McMaster

  • To look at the code used by your TA during tutorial #01, switch to the tutorial branch:
    • git checkout tutorial
  • If you want to go through the step-by-step demo done during lecture #04, look at the dojo directory.
    • Each step of the demo is available through a dedicated tag:
      • Initial conditions: git checkout demo_step_0
      • Walking skeleton git checkout demo_step_01
      • Minimal & viable product: git checkout demo_step_02
      • Second refactor: git checkout demo_step_03
  • To look at the solution designed during Lecture #04 (Case Study: The Tennis Counting), switch to the solution branch:
    • git checkout solution

2aa4-tennis's People

Contributors

mosser 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.