Giter VIP home page Giter VIP logo

truco's Introduction

Truco

https://marianogappa.github.io/truco-argentino/

Truco argentino implementation, featuring:

game

Screenshot 2024-06-23 at 19 26 11

Installation

Either install using Go

$ go install https://github.com/marianogappa/truco@latest

Or download the latest release binary for your OS.

Usage

Start a server

$ truco server

You may change the port (default is 8080) via environment variable

$ PORT=1234 truco server

If you want to play via example terminal-based frontend, start two clients on separate terminals

$ truco player 1
$ truco player 2

Playing with someone else over the Internet

Whoever starts the server may expose it to the Internet somehow, e.g. via cloudflared tunnels

$ cloudflared tunnel --url localhost:8080

Then, 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

$ truco player 1 retail-curves-bernard-affairs.trycloudflare.com
$ truco player 2 retail-curves-bernard-affairs.trycloudflare.com

Reconnect after issue

If the server dies, state is gone. If client dies, you can simply reconnect to the same server and game goes on.

I don't like your UI

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.

I don't like your Bot

It's just an example bot, which beats me. I encourage you to implement your own bot. You may browse the documentation and the existing bot code to guide your implementation.

Technology stack

  • This truco 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

Known issues / limitations

  • Don't resize your terminal. This is a go-termbox issue. Also, have a terminal with a decent viewport. That is on me mostly.

Issues / Improvements

Please do create issues and send PRs. Also feel free to reach me for comments / discussions. I'm not hard to find.

truco's People

Contributors

marianogappa avatar

Watchers

 avatar  avatar

truco's Issues

AI is not at a level that beats me

Therefore, work on it is not done.

Ideas:

  • [] Falta envido logic missing. At the moment, it is called as the "highest stake possible", with equal weight as the others. It could be a really bad choice to call Falta Envido (e.g. one could win more points with something else).

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.