9个版本
0.2.5 | 2023年10月26日 |
---|---|
0.2.4 | 2023年10月26日 |
0.1.1 | 2023年10月14日 |
0.0.0 | 2023年10月13日 |
#109 in 编程语言
53次每月下载
8KB
96 行
FKYSoxide
这是一个F*cking Kill Yourself语言解释器,独立用Rust重写。
语法
e - exit programm
> - moves pointer right
< - moves pointer left
+ - increments cell
- - decrements cell
i - integer output mode (enabled by default)
c - character output mode
n - inserts newline
s - inserts space
o - prints the contents of the cell to the console
p - accepts input from the user into the cell
l - sets cell value to 125
[] - loop (runs while the cell != 0)
# - comments the rest of line
制表符、空格和其他符号将被忽略
安装
只需在终端中运行cargo install --locked fkys-rs
。
用法
要运行脚本,只需传递fkysoxide <脚本路径-to-script>
。
代码示例
使用+
和-
分别增加或减少当前单元格中的值。
此示例将单元格的值设置为3。
++++-
使用l
将单元格的值设置为125
l---
现在0号单元格的值为122。
使用o
输出当前单元格的值,使用p
从stdin输入数字。
p---o
如果我们输入20,代码将输出17。也可以使用s
输出空格,并使用n
换行。
如果你想要输出文本?你可以这样做。使用c
进入文本输出模式,并使用i
返回数字输出模式。在文本输出模式下,数字根据ASCII表转换为字符。例如,以下代码输出Hello, world!
cl-----------------------------------------------------o
>l------------------------o+++++++oo+++o>+++++++++++
+++++++++++++++++++++++++++++++++os>l------o<<o+++o------o----
----o>-----------o
但是,如果你删除了c
,代码将输出这个
7210110810811144 11911111410810033
循环重复,直到当前单元格的值不等于0。例如,此示例输出整个ASCII表。
l[oscoin-]
你可以使用#
注释代码行
++++ # 4
--- # 1
使用e
退出程序(代码0)
依赖关系
~1.3–2MB
~37K SLoC