a Go implementation of the game of Briscola

BrisGolang

BrisGolang is a Go implementation of the game of briscola using the WebSocket protocol for client/server communication.

Usage

You can play in 2 ways:

  1. not using the server
  2. using the server

Not using the server

Start the game with go run .

$ go run .

------------- brisGolang -------------

game:       
  players:  
    MAX:   [
    
     
     
      ] 0
    MIN:   [
       
        
        
         ] 0 table: [] trump: ------------- round 1 ------------- game: players: MAX: [5♥ 6♥ 6♠] 0 MIN: [K♣ 4♣ T♥] 0 table: [] trump: ♥ > cardIdx (0,1,2) [default=0]: 
        
       
      
     
    
   

At the prompt type the index of the card (0, 1, 2) you want to play

Using the server

Launch the server

$ go run server/server.go 
http server started on localhost:8080

In another terminal use wscat (or something similar) to open a connection

$ wscat -c ws://localhost:8080/ws
Connected (press CTRL+C to quit)
> 

Type newGame to create a new game

> newGame
< 
game:       
  players:  
    MAX:   [
    
     
     
      ] 0
    MIN:   [
       
        
        
         ] 0 table: [] trump: > 
        
       
      
     
    
   

Type start to start the game

> start
< 
------------- round 1 -------------
< 
game:       
  players:  
    MAX:   [7♠ K♠ J♦] 0
    MIN:   [6♥ T♦ Q♥] 0
  table:   []
  trump:   ♣
> 

Type play and the index of a card (0, 1, 2) to play

> play 1
< 
game:       
  players:  
    MAX:   [7♠ 
   
     J♦] 0
    MIN:   [6♥ T♦ Q♥] 0
  table:   [{MAX K♠}]
  trump:   ♣
< 
game:       
  players:  
    MAX:   [7♠ 
    
      J♦] 0
    MIN:   [6♥ T♦ 
     
      ] 0
  table:   [{MAX K♠} {MIN Q♥}]
  trump:   ♣
< 
------------- round 2 -------------
< 
game:       
  players:  
    MAX:   [7♠ 2♥ J♦] 7
    MIN:   [6♥ T♦ A♣] 0
  table:   []
  trump:   ♣
> 

     
    
   

TODO

  • a multiplayer version
  • a real client
Owner
Calogero Miraglia
I use this corner to share prototypes and tools I build for fun.
Calogero Miraglia
Similar Resources

snake game implementation using 2d array in Go

snake game implementation using 2d array in Go

Snake Game Implementation Snake game implementation in Go using a 2-dimensional array. Demo Install download the package git clone https://github.com/

May 14, 2022

An implementation of Conway's Game of Life.

An implementation of Conway's Game of Life.

Conway's Game of Life From Wikipedia, the free encyclopedia: The Game of Life, also known simply as Life, is a cellular automaton devised by the Briti

Mar 16, 2022

A dead simple 2D game library for Go

A dead simple 2D game library for Go

Ebiten (v2) A dead simple 2D game library for Go Ebiten is an open source game library for the Go programming language. Ebiten's simple API allows you

Dec 28, 2022

Engo is an open-source 2D game engine written in Go.

Engo A cross-platform game engine written in Go following an interpretation of the Entity Component System paradigm. Engo is currently compilable for

Dec 26, 2022

Go 3D Game Engine

Go 3D Game Engine

G3N - Go 3D Game Engine G3N (pronounced "gen") is an OpenGL 3D Game Engine written in Go. It can be used to write cross-platform Go applications that

Jan 9, 2023

A Game Server Skeleton in golang.

A Game Server Skeleton in golang.

A game server skeleton implemented with golang. 注意(NOTICE) 欢迎加入QQ群: 459420581 (Gopher成都,讨论一切与go有关的话题) gonet/2 gonet1已停止维护(I no longer maintain this, p

Dec 26, 2022

Scalable Distributed Game Server Engine with Hot Swapping in Golang

Scalable Distributed Game Server Engine with Hot Swapping in Golang

GoWorld Scalable Distributed Game Server Engine with Hot Reload in Golang Features Architecture Introduction Get GoWorld Manage GoWorld Servers Demos

Dec 25, 2022

A game server framework in Go (golang)

Leaf A pragmatic game server framework in Go (golang). Features Extremely easy to use Reliable Multicore support Modularity Community QQ 群:376389675 D

Jan 2, 2023

Lightweight, facility, high performance golang based game server framework

Lightweight, facility, high performance golang based game server framework

Nano Nano is an easy to use, fast, lightweight game server networking library for Go. It provides a core network architecture and a series of tools an

Jan 1, 2023
AircraftWar - a game powered by Go+ spx game engine
AircraftWar - a game powered by Go+ spx game engine

AircraftWar - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download thi

Jan 5, 2022
FlappyCalf - a game powered by Go+ spx game engine
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022
FlappyCalf - a game powered by Go+ spx game engine
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022
MazePlay - a game powered by Go+ spx game engine
MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this g

Dec 16, 2021
A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!
A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

galactic-asteroid-belt Overview A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy! Run To run, you will need Go

Dec 2, 2021
RundQuiz-Game - This is a Go exercise that implements and builds a quiz game from a list of math questions in a CSV file.

Go RundQuiz Game Exercise details This exercise is broken into two parts to help simplify the process of explaining it as well as to make it easier to

Jan 5, 2022
Simple 2D game to teach myself various things about game development and ECS, etc

2d-grass-game I really don't know what to name this game. Its a big grass field, and its in 2d so....2D Grass game This is a simple 2D game to teach m

Jan 17, 2022
An implementation of the popular game Codenames created with Go and React.

OpenCodenames A real-time implementation of Codenames created with React/TypeScript and Golang. You can play the game here! Installation Stack: React

Aug 8, 2021
A go implementation of Conway's game of life

go-life A go implementation of Conway's game of life. The program takes input from stdin. It's recommended to use it as cat input.txt | go-life with i

Oct 20, 2021
Go implementation of 2048 game

Go implementation of 2048 game

Oct 21, 2021