Play chess with Go, HTML5, WebSockets and random strangers!

Overview

ChessBuddy

Play chess with Go, HTML5, WebSockets and random strangers!

Hint: Open the page in two different tabs, if there aren't any other visitors around.

Quick Start

ChessBuddy is compatible with Go 1. Use the go tool to install the latest version of ChessBuddy with the following command:

go get github.com/tux21b/ChessBuddy

This will install a new command ChessBuddy in your path (usually $GOPATH/bin/ChessBuddy). Start the HTTP server with the default arguments:

ChessBuddy -http=:8000 -time=5m

Visit http://localhost:8000/, wait for a friend and start playing a game of chess.

You can use go get -u github.com/tux21b/ChessBuddy to update ChessBuddy.

Features

  • web service connects all visitors in pairs and maintains the chess games
  • JavaScript client displays the chess board using the HTML 5 canvas API
  • Time control: 5 minutes (configurable) per side, sudden death
  • move history displays all moves using standard algebraic notation (SAN)

Missing / Planned Features

  • support for underpomotion (currently pawns are always promoted to queens)
  • add some animations to the javascript interface
  • add a couple of AI players (maybe by connecting another engine such as gnuchess or crafty) which can be selected if no other visitors are available
  • starting new games without refreshing the page

License

ChessBuddy is distributed under the Simplified BSD License:

Copyright © 2012 Christoph Hack. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the copyright holder.

You might also like...
A small go program that solves the Queen's Gambit chess puzzle.

Queen's Gambit Solver This program attempts to solve the Queen's Gambit each time it is run. The Queen's Gambit is a chess-based puzzle where eight qu

A simple chess engine for experiment, made in Golang

chess-engine A simple chess engine for experiment, made in Golang Build the engine Run the command make or make build Run the engine Run the command f

chess.com api wrapper for go

Chessdotcom-go An unofficial, simple, lighweight API wrapper for chess.com written in go Usage go get -u "github.com/ATTron/chessdotcom-go" im

A chess server built with Temporal.
A chess server built with Temporal.

chesstempo A chess server built with Temporal. Dependencies The activity worker runs Stockfish in the background. In Debian-based distros, you can ins

Online multiplayer board game server written in Go, using WebSockets.

BfH Server The Battle for Hermannia is a board game created as a gift by the father of hermannm, a developer of this project. This digital edition of

Awesome 2D Maze-based games to play with kids in family and with friends on rich console UI. developed into Go.
Awesome 2D Maze-based games to play with kids in family and with friends on rich console UI. developed into Go.

gomazes Have fun time with kids and family and friends at playing awesome 2D maze-based games while feeling like a programmer on the computer console/

Vote, play, and chill.

GoDiscordBot Template GoDiscordBot is a Discord bot template repository that helps you quickly get started builing a Discord bot in go. Get GoDiscordB

lets play a game

Flashbots is a research and development organization formed to mitigate the negative externalities and existential risks posed by miner-extractable value (MEV) to smart-contract blockchains.

Golang RISC-V emulator that can play DOOM
Golang RISC-V emulator that can play DOOM

RISC-V Emulator A toy Golang RISC-V emulator that can play DOOM For now it uses smunaut bootloader and riscv_doom from the ICE40 project. But since th

Comments
  • Project Structure?

    Project Structure?

    Hey, I'm interested in Go, and trying to figure out standard project structure. I noticed that your main.go code includes itself via its github address (see https://github.com/tux21b/ChessBuddy/blob/master/main.go#L13). Is that standard?

    This could just be a question or it could be an actual issue.

    opened by Crisfole 2
  • Black pawns capture forward

    Black pawns capture forward

    Have a look at these steps:

    1. a2-a4 h7-h5
    2. d2-d4 d7-d5
    3. e2-e3 c7-c6
    4. f2-f4 f7-f5
    5. b2-b4 b7-b5
    6. a4xb5 a7-a6
    7. b5xa6 Nb8xa6
    8. h2-h4 Na6-b8
    9. Bf1-b5 c6-c5
    10. c2-c3 d5xd4
    11. c3xd4 c5-c4
    12. f4xf5 h5xh4

    As you can see, the pawns (black an white) can capture other figures that are straight ahead (step 12). But as far as I know, they are only allowed to capture on a diagonal position. The white player is able to capture diagonal as well (11.1), but the black one is not able.

    opened by MarkusH 1
  • Error when running go get

    Error when running go get

    When I run "go get github.com/tux21b/ChessBuddy" I get this error:

    package code.google.com/p/go.net/websocket: unable to detect version control system for code.google.com/ path

    opened by prudencioj 2
  • defeated AI hangs

    defeated AI hangs

    I finally managed to nudge the AI into an inescapable corner, but the AI refused to make its only available move, and after waiting four minutes or so for the timer to run down, nothing happened.

    Screenshot: http://zephyrtronium.us/snapshot1.png 19. Kd2 Ne4# :c

    opened by zephyrtronium 0
Chesscode - Chesscode: a way of encoding messages using a chess board and the starting set of chess pieces

chesscode Are you a spy that needs to leave an urgent top secret message for an

Logan Spears 11 Jan 1, 2022
♛♔ Play chess against UCI engines in your terminal.

uchess ♛♔ Play chess in your terminal. Introduction uchess is an interactive terminal chess client designed to allow gameplay and move analysis in con

Travis Whitton 48 Nov 17, 2022
Play chess in your terminal

Gambit Chess board in your terminal. Warning gambit does not have many features at the moment. I plan on adding a chess engine, mouse support, timers,

Maas Lalani 440 Nov 22, 2022
A cli to play chess against an an UCI engine of your choice, written in go

chess-cli chess-cli is a cli for playing chess against an UCI compatible engine written in go Note: Chess pieces are in unicode, so the color may seem

Nemo 1 Mar 1, 2022
A cli to play chess against an an UCI engine of your choice, written in go

chess-cli chess-cli is a cli for playing chess against an UCI compatible engine written in go Note: Chess pieces are in unicode, so the color may seem

Nemo 0 Dec 24, 2021
A chess engine written in golang

Weasel Art graciously provided by Alex Table of Contents: About Installing and Compiling from Source Contributing License About Weasel is an 0x88 and

WeaselChess Club 19 Sep 15, 2022
Currently in beta testing. A chess engine written in golang

Weasel Art graciously provided by Alex Table of Contents: About Installing and Compiling from Source Contributing License About Weasel is an 0x88 and

Weasel 19 Sep 15, 2022
chess package for go

chess Introduction chess is a set of go packages which provide common chess utilities such as move generation, turn management, checkmate detection, P

Logan Spears 393 Nov 5, 2022
A chess GUI build using the Fyne toolkit.

Chess The subject of my current live stream series. A simple chess UI built with Fyne. Thanks to: Chess Go library by Logan Spears github.com/notnil/c

Andy Williams 35 Nov 10, 2022
Blunder is an open-source UCI compatible chess engine.

A UCI compatible chess engine written in Golang

Christian Dean 198 Nov 2, 2022