https://devblac.github.io/chinchon/
Chinchón card game implementation, featuring:
- websocket-based client/server architecture
- example terminal-based frontend
- example React-based frontend, and a simple, documented interface for making your own frontend
- example bot, and a simple, documented interface for making your own
Either install using Go
$ go install https://github.com/devblac/chinchon@latestOr download the latest release binary for your OS.
Start a server
$ chinchon serverYou may change the port (default is 8080) via environment variable
$ PORT=1234 chinchon serverIf you want to play via example terminal-based frontend, start two clients on separate terminals
$ chinchon player 1$ chinchon player 2Whoever starts the server may expose it to the Internet somehow, e.g. via cloudflared tunnels
$ cloudflared tunnel --url localhost:8080Then, the clients can connect to the address the tunnel provides, e.g. if tunnel says
...
2024-06-23T18:35:10Z INF +--------------------------------------------------------------------------------------------+
2024-06-23T18:35:10Z INF | Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): |
2024-06-23T18:35:10Z INF | https://retail-curves-bernard-affairs.trycloudflare.com |
2024-06-23T18:35:10Z INF +--------------------------------------------------------------------------------------------+Start the clients with
$ chinchon player 1 retail-curves-bernard-affairs.trycloudflare.com$ chinchon player 2 retail-curves-bernard-affairs.trycloudflare.comIf the server dies, state is gone. If client dies, you can simply reconnect to the same server and game goes on.
It's just an example UI. I encourage you to implement your own frontend. You may browse the documentation and the existing React-based UI code and terminal UI code to guide your implementation.
It's just an example bot. I encourage you to implement your own bot. You may browse the documentation and the existing bot code to guide your implementation.
- This Chinchón engine is written 100% in Go
- Terminal-based UI uses Termbox
- React-based UI uses TinyGo with WASM target to transpile to WebAssembly, and the frontend itself is built in React
- Don't resize your terminal. This is a go-termbox issue. Also, have a terminal with a decent viewport. That is on me mostly.
Please do create issues and send PRs. Also feel free to reach me for comments / discussions.