Git Product home page Git Product logo

waro_groovy's Introduction

Build Status

WarO_Groovy

The War-O code kata in Groovy.

To run:

  • install Gradle from http://gradle.org
  • configure numCards, numGames and players in config.groovy
  • type (or script):
gradle run

Rules:

Use a deck of N cards with no suits, just natural numbers from 1 to N. (as in Rack-O http://en.wikipedia.org/wiki/Rack-O)

Shuffle and deal N cards evenly to X players and a kitty.

For each round:

  • Reveal a card from the kitty. This is the 'prize card'.
  • Each player selects a 'bid' from his/her hand.
  • Bids are revealed: highest bid wins points according to value of the prize card.

After all rounds, player with most points wins.

Example:

Deck is [1,2,3,4,5,6,7,8,9]

John's hand is [2,4,9] Alice's hand is [1,3,8] kitty is [5,6,7]

Round 1, prize card is 5 John bids 4, Alice bids 8 -> Alice wins 5 pts

Round 2, prize card is 6 John bids 9, Alice bids 1 -> John wins 6 pts

Round 3, prize card is 7 John bids 2, Alice bids 3 -> Alice wins 7 pts

Alice wins (12 pts) over John (6 pts)

waro_groovy's People

Contributors

codetojoy avatar

Stargazers

Evan Porter avatar shizonic avatar Jim Infield avatar

Watchers

Bob Shand avatar  avatar Michael Gauthier avatar James Cloos avatar Evan Porter avatar Christian Southgate avatar Dustin Sparks avatar Derek avatar Sean Whalley avatar Michael Berger avatar Ifo Ikede avatar

Forkers

shizonic

waro_groovy's Issues

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.