Giter Site home page Giter Site logo

hanabi-bot's Introduction

hanabi-bot

This is a framework for creating Hanabi bots that play with each other. It is written in Go. Eventually, the idea is to have the option for players to play together with bots on Hanabi Live.


Instructions for Coding a New Strategy

Copy the "strategy_dumb.go" file and rename it to "strategy_whatever.go". Fill in all of the functions. Then, add whateverInit() to the "strategy.go" file.


Installation (for experts)

  • The project doesn't require any special dependencies. Just clone the repo and go.

Installation (for noobs/contributors)

Like many code projects, we use golangci-lint to ensure that all of the code is written consistently and error-free. We ask that all pull requests pass our linting rules.

The following instructions will set up the development environment and the linter. This assumes you are on Windows and will be using Microsoft's Visual Studio Code, which is a very nice text editor that happens to be better than Atom, Notepad++, etc. If you are using a different OS/editor, some adjustments will be needed (e.g. using brew on MacOS instead of choco).

Note that these steps require an elevated (administrator) command-shell.

  • Install Chocolatey:
    • @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  • Install Git, Golang, and Visual Studio Code:
    • choco install git golang vscode -y
  • Configure Git:
    • refreshenv
    • git config --global user.name "Your_Username"
    • git config --global user.email "[email protected]"
    • git config --global core.autocrlf false
      (so that Git does not convert LF to CRLF when cloning repositories)
    • git config --global pull.rebase true
      (so that Git automatically rebases when pulling)
  • Clone the repository:
    • cd [the path where you want the code to live] (optional)
    • If you already have an SSH keypair and have the public key attached to your GitHub profile, then use the following command to clone the repostory via SSH:
    • If you do not already have an SSH keypair, then use the following command to clone the repository via HTTPS:
      • git clone https://github.com/Zamiell/hanabi-bot.git
    • Or, if you are doing development work, then clone your forked version of the repository. For example:
      • git clone https://github.com/[Your_Username]/hanabi-bot.git
  • Enter the cloned repository:
    • cd hanabi-bot
  • Install the Golang project dependencies and build it:
    • go build
  • Install the Golang linter.
  • Install the VSCode extension for Golang:
    • code --install-extension "golang.go"
  • Open VSCode using the cloned repository as the project folder:
    • code .
  • Test the Golang linter:
    • On the left pane, open "main.go".
    • In the bottom-right-hand corner, click on "Analysis Tools Missing" and then on "Install". You will know that it has finished once it displays: "All tools successfully installed."
    • Add a new line of "test" somewhere, save the file, and watch as some "Problems" appear in the bottom pane.
  • Run the code:
    • Launch a Git Bash shell:
      • "%PROGRAMFILES%\Git\bin\sh.exe"
    • Use the included run script:
      • ./run.sh
        (by default, it uses the Hyphen-ated strategy with 3 players; edit "main.go" to adjust this)

hanabi-bot's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

fpvandoorn rasmoh

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.