Code Monkey home page Code Monkey logo

connect4py's Introduction

connect4Py

Connect4 in python! For interviewing people who know some python.

Information

  • We have set the project up so you can focus on the requirements, no need to worry about rendering anything to the screen. Anything in app.py is not part the test, though if you finish the test, feel free to refactor it.
  • The scaffold class (connect_4.py) has some expectations for it to work correctly:
    • has a board consisting of an nested array of strings
    • the string is only one character long
    • any errors thrown in connect_4.py will not alternate to the other player

Run the tests

➜  connect4py git:(master) ✗ python -m venv venv
➜  connect4py git:(master) ✗ source venv/bin/activate
(venv) ➜  connect4py git:(master) ✗ python -m unittest test/connect_4_test.py
.

User Requirements

As a Player,
I want to be able to select a column
So that I can play the game
As a Player,
I want to have a different identifier for my pieces
So that I know which pieces are mine
As a Player,
I want to be able to win by connecting 4 of my characters horizontally
So that I can beat my opponent
As a Player,
I want to be able to win by connecting 4 of my characters vertically
So that I can beat my opponent
As a Player,
I want to be able to win by connecting 4 of my characters diagonally
So that I can destroy my opponent
As a Games Master,
I want to be able to only accept column numbers
So that I know which column to insert the piece for that player
As a Games Master,
I do not want Players to be able to insert their pieces into columns which are already full
So that I can keep play within bounds
As a Games Master,
When there's no more room to insert pieces and there's no winner
I want to declare the game a draw

connect4py's People

Contributors

phil-meredith avatar

Watchers

Massimiliano Mirra avatar Paul Allton avatar Kingsley Hendrickse avatar bailey avatar  avatar James Cloos avatar  avatar Gavin Sallery avatar  avatar Stéphane avatar Rob Greenoak avatar  avatar Muqeet Malik avatar Piotr avatar  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.