Hello bterm
Terminal game31 lines of .st250 lines of generated Rust
Hello, Bracket Terminal!
On this page
The .st files#
intent.st
structop {
type_app {
exec = {
lang = "Rust"
}
}
lib_provider {
core = {
source = "StructOp/core"
version = "@latest"
}
Screen = {
source = "StructOp/game"
version = "@latest"
}
}
}main.st
ability "game" "Flappy" {
title = "Flappy Dragon"
on_tick = [ability.clear.Screen, ability.text.Hello]
}
ability "clear" "Screen" {
}
ability "text" "Hello" {
x = 1
y = 1
message = "Hello, Bracket Terminal!"
}Input, plan and generated Rust#
input.txt · key script, one line per frame (3 lines)
input.txt · key script, one line per frame (3 lines)
structop plan
structop plan
# program.app will be created
+ program.app (.structop/build/app)
+ ability.game.Flappy
+ ability.clear.Screen
+ ability.text.Hello
Plan: 1 to add, 0 to change, 0 to destroy.Generated main.rs
To inspect this generated file, select Rust in intent.st, initialize the project and export its source.
Export locally
structop init
structop apply -source -no-runTry it
cd rust-hello-bterm # a folder holding the .st files above
structop init
structop plan
structop apply