3 个不稳定版本
使用旧的 Rust 2015
0.2.2 | 2016年12月2日 |
---|---|
0.2.0 | 2015年6月25日 |
0.1.3 | 2015年6月16日 |
在 模拟器 中排名 173
72KB
1.5K SLoC
tis-100-rs

用 Rust 编写的 TIS-100 模拟器。
注意:此项目针对 rust-nightly
频道。
二进制文件
此项目包括两个二进制文件:sandbox
,它实现了 TIS-100 的 简单沙盒 解谜,以及 puzzle
,它可以根据一个规范文件和一个保存文件执行任意解谜。
TIS-100 Sandbox Emulator
Usage:
sandbox <save.txt>
TIS-100 Puzzle Emulator
Usage:
puzzle <spec.lua> <save.txt>
库
如果您想在 Rust 项目中嵌入 TIS-100 模拟器,只需将以下依赖项添加到您的 Cargo.toml
[dependencies]
tis-100 = "0.2.0"
示例
extern crate tis_100;
use tis_100::save::parse_save;
use tis_100::machine::Sandbox;
// This program reads the value from the console and simply passes it to the console output.
let src = "@1\nMOV UP DOWN\n@5\nMOV UP DOWN\n@9\nMOV UP RIGHT\n@10\nMOV LEFT DOWN\n";
let save = parse_save(src).unwrap();
let mut sandbox = Sandbox::from_save(&save);
sandbox.write_console(42);
for _ in 0..5 {
sandbox.step();
}
assert_eq!(sandbox.read_console(), Some(42));
依赖项
~730KB
~19K SLoC