GithubHelp home page GithubHelp logo

connect_four's Introduction

ConnectFour

A competition to find the ultimate bot to beat Connect Four.

Instructions

You will be given a time limit (somewhere around 1 1/2 hours) to create the best bot that you can to play Connect Four.

  • Find a friend or two with whom to pair program.
  • Fork the repo:
  • try out an example match
    • > bin/match PureRandomness PureRandomness
  • create a contender (<project_root>/lib/connect_four/contenders)
    • take a look at PureRandomness for some ideas
    • it needs to be a GenServer that responds to:
      • call :name: (return your team name)
      • call {:move, board} (return the column from 0-6 in which you'd like to play on this turn)
    • utilize the BoardHelper (and refer to the tests) for several functions that simplify some common tasks
      • board evaluation
      • board creation
      • piece at given coordinate
      • "what would the board look like if I dropped my piece in this column?"
      • etc.
    • your GenServer can choose to store state if if wishes, but the full board will be passed each time.
    • the board is a matrix of a List of 6 Lists, 7 integers each (7 across, 6 down):
      • 0 is an empty, eligible space / column
      • 1 is where you've moved previously
      • 2 is where your opponent has moved
    • make sure to run tests
      • > mix test
      • if tests fail against your repo, you will be disqualified
    • test your bot against PureRandomness. if you can't beat it 100% of the time...
      • > bin/match PureRandomness YourBotModuleName
      • the result map for the match will be displayed immediately following the winner announcement
        • this should help you with troubleshooting
        • you can visualize this result by:
          • > iex -S mix
          • iex> ConnectFour.Controller.display_game(result, true)
      • alternatively, you can start a battle (see below) and then display with "Watch the Battle" (see below)
    • your GenServer should respond to all calls within 5 seconds. If not, you forfeit.
      • you are allowed to do as much background processessing as you want between calls.
      • you are allowed to spin up other processes.
      • the lifecyle of your bot will be around 10 seconds.
        • no supervisor will keep it alive (if your GenServer dies, tough luck)
        • it will be started each time a match with your (new) opponent begins
    • if you make a disallowed move (a column that is already full or out of bounds), you also forfeit.
  • run tests again, just to be sure
    • > mix test
  • create a pull request against the original repo's elixirconf2017 branch
  • we'll run a tournament with all the contenders to find the ultimate winner.
    • run yourself to get a log of games played
    • > bin/battle

Results

Watch the battle

  • if you copy the above "Results" folder contents into your cloned repo's results/ folder
    • > bin/display_games

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.