Boston Software Crafters

Sam Backus (He/Him)

Software Engineer - PluralSight

twitter: @SamBackus

email: Samuel.Backus@gmail.com

 gitlab & github: sbackus

slides.com/sambackus/boston-software-crafters-may-2020

slides.com/sambackus/boston-software-crafters-may-2020

The Plan

6:30 Presentation
6:45 Split into group and introduce yourselves

6:50 Code
8:25 Retrospective
8:30 Closing remarks

slides.com/sambackus/boston-software-crafters-may-2020

How we work together

  • We treat each other with kindness, consideration and respect
  • We focus learning and practicing craft over getting things done
  • We verify the correctness of code using Test Driven Development (TDD)
  • We work collaboratively (mob/pair)
  • We use retrospectives to improve

 

slides.com/sambackus/boston-software-crafters-may-2020

Test Driven Development

slides.com/sambackus/boston-software-crafters-may-2020

Mob Programming

slides.com/sambackus/boston-software-crafters-may-2020

Mancala

slides.com/sambackus/boston-software-crafters-may-2020

Setup:

  • The game starts with 4 stones in each of the 12 small pockets
  • Each player controls the 6 pockets on the side closest to them 
  • The two larger pockets are called mancalas.
  • Each player controls the mancala to the right of their row. 

slides.com/sambackus/boston-software-crafters-may-2020

Rules:

  • On your turn pick any pocket on your side of the board. 
  • Pick up the stones in that pocket and distribute them counter clockwise, one in each pocket that you pass, until you run out of stones
  • If you run into your own mancala distribute one stone in it.  
  • If you run into your opponents mancala, skip it

slides.com/sambackus/boston-software-crafters-may-2020

More Rules:

  • If the last piece you drop is in your own mancala take another turn immediately
  • If the last piece you drop is in an empty pocket on your side of the board you capture that piece and any pieces in the opposite pocket.
  • Place all captured pieces in your mancala

slides.com/sambackus/boston-software-crafters-may-2020

The end:

  • The game ends when all pockets on one side of the board are empty
  • The player who still has pieces on their side of the board when the game ends captures all those pieces
  • Count all the pieces in each mancala. The player with the most pieces wins!

slides.com/sambackus/boston-software-crafters-may-2020

Try it:

slides.com/sambackus/boston-software-crafters-may-2020

Coding Mancala:

Represent the board as an array of integers:

[4,4,4,4,4,4,0,4,4,4,4,4,4,0]

Player 1's mancala

Player 2's mancala

0

1

2

3 

4

5 

6

7 

8

9

10 

11

12

13

slides.com/sambackus/boston-software-crafters-may-2020

Coding Mancala:

Knowing the state of the game also requires knowing who's turn it is:
{player: 0, board: [4,4,4,4,4,4,0,4,4,4,4,4,4,0]}
 

slides.com/sambackus/boston-software-crafters-may-2020

Coding Mancala:

slides.com/sambackus/boston-software-crafters-may-2020

Questions?

slides.com/sambackus/boston-software-crafters-may-2020

Boston Software Crafters

By Sam Backus

Boston Software Crafters

  • 303