a lib for playing pusoy dos

Overview

Pusoy Dos core lib

2nd attempt at a pusoy dos library

Build Status

Aims

  • simple external interface
  • configurable rulesets (support Pickering rules and standard Pusoy Dos)
Comments
  • start of round struct

    start of round struct

    The idea around the game/round relationship is that the game (totally breaks the SRP) is a container which acts as a general purpose api for the consumer of the library. It also has the responsibility of keeping track of the initial attributes of the game as a whole (ruleset, options, players).

    The Round is a snapshot of the current state of the game. There are some ownership issues (which I have short term deferred thinking about by blindly cloning) and some parts of Game may do better split out, but that's the rationale behind this PR.

    opened by benbrunton 6
  • Structure Ideas

    Structure Ideas

    Couple of ideas for simpler/flexible structure.

    Cards

    I think cards only need to have rank and suit, and possibly joker/wildcard flag.

    {
      rank: enum,
      suit: enum,
      joker?: boolean,
    }
    

    Jokers

    Feels a bit dirty having the joker flag, and before a joker is played, it has no rank or suit, so maybe the rank and suit enum can contain a Joker type. Then a joker would be

    {
      rank: Rank.Joker,
      suit: Suit.Joker
    }
    

    ~~If we assume that joker is always the strongest possible card, the comparisons don't even need to know anything extra like intended rank and suit. Not sure how feasible this is though, seems tricky to make the comparison function work out the best value for the joker, and would probably cause confusion amongst players if we didn't display a real value.~~

    Maybe best is to do it this way but have a separate struct for PlayedCard which has intended rank/suit value.

    Rules

    Currently rules are made up of suit order and reversed boolean. Might be worth thinking about having the rules made up of suit order and rank order. Then instead of setting reversed = true we would just reverse the suit order and rank order arrays. Seems a little more complicated, but it simplifies comparison, and allows for potential complex rulesets, e.g. suits reverse but ranks stay the same, 3's become top card, or "chess mode" where kings are the weakest.

    Probably we don't need such complicated game rules, but if it isn't too difficult to implement, then there are no downsides compared to the current way.

    Actually rules also include hands, and player order, though they feel different to the comparison rules. If we could incorporate a way to represent them too in the rules, then potentially we could have very different games using the same code, just by writing new rules.

    opened by Roybie 5
  • Submit move

    Submit move

    Opened for comment, not looking to get this merged straight away.

    • Have pulled out comparisons into it's own module.
    • Round looks after general validation of submitted hand and reports back detailed error
    opened by benbrunton 4
  • Publicly visible API key

    Publicly visible API key

    https://github.com/soydos/pusoy_dos2/blob/8acbbef5a7f245c6c226af75806d9b18557d053f/.travis.yml#L16

    Here too same as https://github.com/soydos/wasm-pusoy-dos/issues/3

    opened by Roybie 1
  • add player move to remove cards from hand

    add player move to remove cards from hand

    Made a start on removing cards from players hand. I didn't know if it was best to update the current struct or return a new one, so I did both. We can change that if needs be.

    Also returns an error if the player doesn't have any of the cards that are attempted to play.

    Also added a couple of small tests to comparisons.

    opened by Roybie 1
A vdom-free reactive UI lib for the bevy game engine

ui4 ui4 is my fourth major attempt at making a UI dataflow library for the Bevy game engine. More specifically, it's a vdom-less UI library which uses

null 48 Nov 28, 2022
Simple retro game made using Rust bracket-lib by following "Herbert Wolverson's Hands on Rust" book.

Flappy Dragon Code from This program is a result of a tutorial i followed from Herbert Wolverson's Hands-on Rust Effective Learning through 2D Game De

Praneeth Chinthaka Ranasinghe 1 Feb 7, 2022
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
A fusion of OTP lib/dialyzer + lib/compiler for regular Erlang with type inference

Typed ERLC The Problem I have a dream, that one day there will be an Erlang compiler, which will generate high quality type-correct code from deduced

Dmytro Lytovchenko 35 Sep 5, 2022
Lightweight slowloris (HTTP DoS) implementation in Rust.

slowlorust Lightweight slowloris (HTTP DoS) implementation in Rust. Slowloris is a denial-of-service attack program which allows an attacker to overwh

Michael Van Leeuwen 6 Sep 29, 2022
A simple to use dos tool to support Ukraine 🇺🇦

A short explanation How to download section | Guide for Windows | Guide for macOS This program visits various russian websites in order to keep the se

Grrwahrr 10 Apr 15, 2022
Rust bindings to the dos-like framework

dos-like for Rust   This project provides access to Mattias Gustavsson's dos-like framework, so as to write DOS-like applications in Rust. How to use

Eduardo Pinho 9 Aug 25, 2022
A dos attack for you to use!

Welcome To Rust Dos attacker! Why should I use it? It has unrivaled speeds because it is built in rust and hand optimized. It also comes with an AI mo

Carghai74 5 Dec 2, 2022
Um Web Scrapper para extrair as soluções dos exercícios do Driven HUB com seus respectivos enunciados

hub_scrapper Um Web Scrapper para extrair as soluções dos exercícios do Driven HUB com seus respectivos enunciados, convertendo-os para Markdown. ⚠️ A

Davi Feliciano 4 Oct 7, 2023
A fast, non-cryptographic, minimally DoS-resistant hashing algorithm for Rust.

Foldhash This repository contains foldhash, a fast, non-cryptographic, minimally DoS-resistant hashing algorithm implemented in Rust designed for comp

Orson Peters 155 Oct 23, 2024
A multi-threaded GTK 3 application for fetching the lyrics of the current playing song

Lyriek A multi-threaded GTK 3 application for fetching the lyrics of the current playing song. Installation Arch Linux yay -S lyriek Ubuntu apt insta

Bart Willems 18 Feb 9, 2022
Midnote is a terminal application that reads a MIDI file and displays you its notes bar-by-bar, while playing it.

MIDNOTE Midnote is a terminal application that reads a MIDI file and displays you its notes bar-by-bar, while playing it. Goals As a blind musician my

null 4 Oct 30, 2022
A command line tool for playing with color gradients

gradient A command-line tool for playing with color gradients. Features Lots of preset gradients. Custom gradient. Read gradients from SVG & GIMP grad

Nor Khasyatillah 96 Dec 28, 2022
VanillaWindowsTools - Tools for parsing and playing

VanillaWindowsTools - Tools for parsing and playing

Matthew Seyer 7 Dec 2, 2022
WIP demo project for pure rust playing nicely with MCUBoot/Infinitime OTA

pinetime-rust-mcuboot WIP demo project for pure rust playing nicely with MCUBoot/Infinitime OTA Firmware Behavior This is an example project so I just

David Boles 2 Jan 26, 2022
Playing with web dev in Rust. This is a sample Rust microservice that can be deployed on Kubernetes.

Playing with web dev in Rust. This is a sample Rust microservice that can be deployed on Kubernetes.

André Gomes 10 Nov 17, 2022
A Rust port of the command line program playing with the cutscenes files (USM) from Genshin Impact.

GI-cutscenes : Rust Remix A command line program playing with the cutscene files (USM) from Genshin Impact, reimplemented in Rust. Much like its origi

Lymkwi 5 Nov 6, 2022
Encrypt and decrypt files by playing melodies on your MIDI keyboard.

midicrypt Encrypt and decrypt files by playing melodies on your MIDI keyboard. Written in Rust. ❯ ./midicrypt -h midicrypt 0.1.0 NINNiT Encrypts and D

null 2 Jun 24, 2022
A cli utility for playing music mixes for programming & focus from musicforprogramming.net

mfp: music for programming A command-line utility for playing music mixes for programming & focus (from musicforprogramming.net), unlocking the flow s

Rohit Gupta 10 Jul 12, 2023
JWT lib in rust

jsonwebtoken API documentation on docs.rs See JSON Web Tokens for more information on what JSON Web Tokens are. Installation Add the following to Carg

Vincent Prouillet 1.1k Jan 3, 2023