Giter Club home page Giter Club logo

captains-mistress's Introduction

Captain's Mistress Workshop

Please note: there are several branches in this repo:

  • MASTER is the baseline (original) repo,
  • RHN1 is the branch representing the work completed at Ruby Hack Night July,
  • RHN2 is the branch representing the work completed at Ruby Hack Night September,
  • RHN3 is the branch representing the work completed at Ruby Hack Night November.

###Introduction

During his long sea voyages, Captain Cook often retired to his cabin for long periods. The crew used to joke that he had a mistress hidden away. Soon they discovered that the Captain had simply been playing this game with the ship's scientist. Thus it came to be known as 'The Captain's Mistress’.

This repo contains an exercise for our ninth(?) workshop presented by me, David Andrews. This workshop is about teamwork and integration of much of our past workshop topics.

We have provided a repository which mimics the setup we used last time, so it should be familiar. The code to be created is found in the lib/ directory, and we have supplied the beginning of unit tests in the spec/ directory.

###Setup

Here are the steps to get you started with the repo. We assume, naturally, that you have a working development machine with Ruby 1.9 or better on it. At Ryatta Group we use rbenv, and so we've included some optional elements - just skip them if you're using rvm or are not versioning your Ruby.

% git clone [email protected]:k00ka/captains-mistress.git
% cd captains-mistress
% gem install bundler
Fetching: bundler-1.7.4.gem (100%)
Successfully installed bundler-1.7.4
1 gem installed
% bundle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Installing rake 10.3.2
...
Using bundler 1.7.4
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

######Note: if you use rbenv...

% rbenv rehash

You are (almost) there!

=== Instructions for the first session:

###Rules

  1. The game consists of balls and a rack.
  2. There are 2 coloured sets of 21 balls each, coloured black and white.
  3. The rack has 7 channels (columns) and 6 rows.
  4. The rack is oriented vertically so that the balls create 7 stacks.
  5. Two players take turns dropping balls into the channels.
  6. A ball falls until it lands on top of the existing stack, or the bottom of the rack.
  7. Players cannot drop balls into channels that are full.
  8. The winner is the first player to create a line of four balls in any direction.

###The game?

No, not Bejeweled.
It's Connect Four!
[see the deck for images]

###From the very(!) high level here is what we need:

  • The Game and 2 Players.
  • The Game entity manages
    ** the game board
    ** enforcing the rules (including flow of play), and
    ** game state (including winning conditions).
  • The Player entity answers the question
    ** what is your next move?
  • The Player entity will want to ask questions about the game state in order to make decisions.
    ** How do Players ask questions? Through an API!

###Divide and conquer

Split up into three teams:

  1. Strategy Team 1
  2. Strategy Team 2
  3. Game Core Team

###Plan for development

####Phase 1

Game Core Team - use TDD to develop the game components
Strategy Team 1 & 2 - research play strategies

####Phase 2

All - work together to define the API

####Phase 3

Game Core Team - build the API
Strategy Team 1 & 2 - implement (several?) strategies

####Phase 4

All - pit players against each other and play!

###Useful resources ####Game Core Team https://www.pivotaltracker.com/n/projects/1396446

####Strategy Teams http://gizmodo.com/heres-how-to-win-every-time-at-connect-four-1474572099
https://en.wikipedia.org/wiki/Connect_Four

If you want to learn (more) about TDD, there are plenty of online resources. For a quick primer, you can review our blog post from the previous workshop: [http://www.ryatta.com/refactoring-in-context/]

The first part of this project was presented at Ruby Hack Night on July 29, 2015. The output from that session is contained in the rhn1 branch.

The second part of this project as presented at Ruby Hack Night on August 27, 2015 in the rhn2 branch. Instructions are contained in the PDF available in the root of the project on the rhn2 branch. The output from that session was pushed to the rhn2 branch so we have a final record of all work.

The third part of this project is being presented at Ruby Hack Night in November.

captains-mistress's People

Contributors

k00ka avatar

Watchers

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