a game where you're given a potato and your job is to implement a firmware for it https://kartoffels.pwy.io
  • Rust 98%
  • Nix 0.9%
  • JavaScript 0.6%
  • Just 0.3%
  • HTML 0.2%
Find a file
2025-11-22 22:43:12 +01:00
app fix(server): Support text WebSocket messages 2025-09-12 22:30:04 +02:00
nixos nixos: Remove unused option 2025-09-12 22:18:55 +02:00
readme readme: Update images 2025-02-17 17:13:55 +01:00
web chore: s/github/codeberg 2025-08-13 20:40:01 +02:00
.gitignore app: s/data/store 2025-02-09 16:45:13 +01:00
flake.lock chore: Bump toolchain 2025-08-02 23:06:09 +02:00
flake.nix chore: Bump toolchain and dependencies 2025-02-17 17:00:37 +01:00
Justfile justfile: Add run-vg 2025-05-31 19:39:00 +02:00
LICENSE Hello, World! 2024-06-02 18:16:35 +02:00
README.md readme: Add project status 2025-11-22 22:43:12 +01:00

kartoffels 🥔

status: after a long thought, i've decided to suspend the development of this project, at least for now - for the past months i've been juggling too many things and i've realized i need to be more focused if i want to make the best use of my time and resources.


kartoffels is an online game where you're given a potato and your job is to implement a firmware for it:

Image Image

play it in browser or terminal:
ssh kartoffels.pwy.io



name

kartoffel (🇩🇪)
= potato
= slang for slow machine
= exactly what kartoffels are!

build

so you want to launch kartoffels on your own machine? easy!

using nix

# step i: clone repository
$ git clone https://codeberg.org/pwy/kartoffels
$ cd kartoffels

# step ii: create a place for storing kartoffels, server keys etc.
$ mkdir store

# step iii: launch server
$ nix run . -- serve ./store --ssh 127.0.0.1:1314

# step iiii: join the game
$ ssh 127.0.0.1 -p1314

note that this only starts the ssh server - if you want to use the web frontend:

# step iii: launch server (note the `--http` argument)
$ nix run . -- serve ./store --http 127.0.0.1:1313

# step iiii: launch frontend
$ nix run .#web

# step iiiii: join the game at http://localhost:5173

on linux / macos

# step i: clone repository
$ git clone https://codeberg.org/pwy/kartoffels
$ cd kartoffels

# step ii: build application
$ cd app
$ cargo build --release
$ cd ..

# step iii: create a place for storing kartoffels, server keys etc.
$ mkdir store

# step iiii: launch server
$ ./app/target/release/kartoffels serve ./store --ssh 127.0.0.1:1314

# step iiiii: join the game
$ ssh 127.0.0.1 -p1314

note that this only starts the ssh server - if you want to use the web frontend:

# step iiii: launch server (note the `--http` argument)
$ ./app/target/release/kartoffels serve ./store --http 127.0.0.1:1313

# step iiiii: launch frontend
$ cd web
$ npm install
$ npm run dev

# step iiiiii: join the game at http://localhost:5173

on windows

i'd suggest installing wsl and following the linux instructions

contribute

so you want to contribute to kartoffels? easy! -- the code is divided into roughly three areas:

  • all things risc-v (kartoffels-cpu),
  • all things world-and-bot (kartoffels-world),
  • all things user-interface (kartoffels-front).

so, say:

  • if you wanted to introduce support for risc-v compressed instructions, you'd modify (mostly) kartoffels-cpu,
  • if you wanted to introduce a new bot peripheral, you'd modify (mostly) kartoffels-world,
  • if you wanted to introduce a new challenge, you'd modify (mostly) kartoffels-front.

note that those are just rough examples, different features or fixes might require touching different places

also:

  • use cargo test --release and cargo fmt,
  • some tests (notably those ui-based) utilize snapshots - they take a "screenshot" (a textshot?) of the current frame and compare it against the expected frame - you can run just test-and-bless to quickly fix such tests after you e.g. modify a commonly-used ui widget,
  • pls don't introduce larger changes (e.g. a new peripheral) without some discussion first - it might happen that something hasn't been implemented deliberately and i wouldn't like for people to waste time just to tell them "sorry, it doesn't fit my vision"

license

copyright (c) 2024, patryk wychowaniec (pwychowaniec @at@ pm.me).

this program is free software: you can redistribute it and/or modify it under the terms of the gnu general public license as published by the free software foundation, version 3.

this program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. see the gnu general public license for more details.

you should have received a copy of the gnu general public license along with this program. if not, see https://www.gnu.org/licenses/.