Skip to content(if available)orjump to list(if available)

Checkers written in Rust and exported to WASM

swiftcoder

I thought this was going to be a type checker :)

dhosek

You’re not alone

jasonthorsness

I like the attribute-based approach to wasm bindings in rust, it keeps it clean and to one file, and refreshing how you just have a plain HTML file and just instantiate the module with

import init, { Checkers } from "./pkg/checkers.js";

J_Shelby_J

I wish the Rust web frameworks were this simple. I mean, they're not insane, but they're just really complex due to all of the use cases they support. Dioxus needs a "lite" mode.

keepamovin

Bunch of cool games are here: https://kevinalbs.com/#!games

:)

imtany

Please rename to checke.rs :D

kevinAlbs

Hello, original author here. I was delightedly surprised to see this game got attention. I believe I referenced https://wcdf.net/rules.htm when writing the game. The game has been updated. If a piece is clicked and has no moves, pieces with moves are briefly highlighted.

Blackarea

You got the src on github or something? Am learning rust myself and it seems like a neat little sample project

millerm

There’s a link on the page of the game.

zeristor

Oh, you mean Draughts, I thought this was some sort of parser

stabbles

Can't take backwards, looks like a bug.

MyOutfitIsVague

If your piece isn't a king, capturing backwards isn't legal.

littlestymaar

Only if you aren't using the metric system ;)

bsaul

it got locked after 10 moves or something like that (firefox browser). I couldn't move anything no matter where i clicked (and i was far from the end of the game)

EDIT : sorry, seems like i probably had to make a forced jump move, which i didn't know was a thing.

EDIT 2 : aren't you supposed to be able to capture in reverse direction ?

amelius

For me it locked after 1 move. But then I found out that I was also playing for the opponent.

keepamovin

I like how these engineers think they found a bug but were actually just beaten by the correct implementation of the rules of checkers hahaha

MyOutfitIsVague

It's pretty surprising to me the number of people who don't know the rules of checkers here. I guess they were probably taught by a friend or family member who was using house rules.

kaoD

> aren't you supposed to be able to capture in reverse direction ?

Only after promotion.

bool3max

checke(rs)

throwaway0665

I was about to comment saying it was broken and forces you to jump. But it turns out I've just been playing checkers wrong my whole life.

maxnoe

All checkers games I ever played started with a long negotiation about the rules...

wiktor-k

Exactly. I was surprised that this one doesn't support multi capture when available.

millerm

It does. Don’t forget, only a king can go backwards.

arijun

It does, not sure what you're seeing. Maybe the second jump was in the reverse direction, and thus not legal?

echelon

It forces multi capture when available.

eptcyka

Does it not?

kevinAlbs

I believe I referenced https://wcdf.net/rules.htm for rules. I had these questions myself when writing the game. Updated the README to link to the intended rules.

eyelidlessness

I guess I have too? So has everyone I’ve ever played with.

vlovich123

There’s a lot of different checkers variants.

null

[deleted]