Pusoy Dos core lib
2nd attempt at a pusoy dos library
Aims
- simple external interface
- configurable rulesets (support Pickering rules and standard Pusoy Dos)
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.
I think cards only need to have rank and suit, and possibly joker/wildcard flag.
{
rank: enum,
suit: enum,
joker?: boolean,
}
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.
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 for comment, not looking to get this merged straight away.
https://github.com/soydos/pusoy_dos2/blob/8acbbef5a7f245c6c226af75806d9b18557d053f/.travis.yml#L16
Here too same as https://github.com/soydos/wasm-pusoy-dos/issues/3
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.
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
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
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
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
slowlorust Lightweight slowloris (HTTP DoS) implementation in Rust. Slowloris is a denial-of-service attack program which allows an attacker to overwh
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
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
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
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
Foldhash This repository contains foldhash, a fast, non-cryptographic, minimally DoS-resistant hashing algorithm implemented in Rust designed for comp
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
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
gradient A command-line tool for playing with color gradients. Features Lots of preset gradients. Custom gradient. Read gradients from SVG & GIMP grad
VanillaWindowsTools - Tools for parsing and playing
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
Playing with web dev in Rust. This is a sample Rust microservice that can be deployed on Kubernetes.
GI-cutscenes : Rust Remix A command line program playing with the cutscene files (USM) from Genshin Impact, reimplemented in Rust. Much like its origi
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
mfp: music for programming A command-line utility for playing music mixes for programming & focus (from musicforprogramming.net), unlocking the flow s
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