Giter Club home page Giter Club logo

dice's Introduction

TDD Challenge

The library

The aim is to implement a library that accepts a string command representing a roll of the dice. These commands may look like:

1d20
8d6

Maths can also be done with the results of these rolls:

1d20+5
4d6 + 3d8
1d2*3d6

There are also some more complex functions to be done with the dice:

1d20<2
4d6k3
10d6!

For a complete reference to what should be possible, see the roll20 dice reference

The challenge

You should work in a pair to test drive this functionality out. I want you to ping pong on this.

Ping ponging is a pseudo-competitive tdd/pairing strategy. You alternate turns first completing the other person's test, refactoring if necessary and then writing a test back for the other person. The reason I describe this as pseudo-competetive, is that you want to write as little code as possible. If you can get away with returing 4, return 4! Refactors should only be done when needed. You almost want to trap the other person into writing the code with your tests.

This is great for test coverage, as you drive out every edge case within the system. It's also a great pairing strategy as it keeps both people engaged.

dice's People

Contributors

xepps avatar

Watchers

 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.