Crates.io | chapter |
lib.rs | chapter |
version | 0.1.0 |
source | src |
created_at | 2023-10-15 12:50:57.58219 |
updated_at | 2023-10-15 12:50:57.58219 |
description | An implementation of the Yarn Spinner runtime. |
homepage | |
repository | https://github.com/will-hart/chapter |
max_upload_size | |
id | 1003694 |
size | 118,386 |
Chapter is a fork of the yharnam
repository which is a rust parser and "runner" for Yarn
Spinner v1 files.
This version started as a fork, but it seems like the original is no longer maintained. This version updates the supported Yarn Spinner version to 2.3, and adds in additional methods and functions that were not originally implemented.
Currently it is only capable of running pre-compiled Yarn Spinner files. A
parser for .yarn
files is in progress.
NOTE to run tests you will need to download a copy of
ysc
, and use it to compile each of the test.yarn
files.
Currently tested on Yarn Spinner 2.3.0.
This feature is enabled by default
Use the random
feature to enable random operations such as dice
, random
and random_range
. An additional non-standard function random_test
is
provided. This takes a threshold between 0-1 and randomly generates a boolean
based on whether a random number is above or below the threshold (see gen_bool
from the rand
crate).
In addition the random generator can be supplied a seed by calling
vm.seed_random_generator(u64)
. See the random tests for an example.