$ git clone [email protected]:DuskyElf/rpg-rs.git
$ cd rpg-rs
$ git checkout tags/v0.0.1-alpha
"Hello, World! This is just so awesome!!!"
?0 "What is your name?"
"Which Branch?" {
"first" => {
?1 "What is your age?"
"Hi $0, you are $1 years old!"
}
"second" => {
"Are you 18+ $0?" {
"yes" => { "Whooo, you can vote" }
"no" => { "Sorry, you can't vote" }
}
}
}
$ cargo r --release test.rpg
- Variables
- Asking question into a variable (identifier)
- Branching System
Currently, it clears the terminal and animates the message as it being typed, then stops for the user to proceed.
"Example message"
Currently, it clears the terminal and animtes the question as it being typed, then stops for the user to type in the answer till a newline. Then saves the answer in the variable index provided (0
in the following example).
?0 "What's your name?"
As stated above, questions save the answer in the variable index provided. Those values could be accessed via the index as $<index>
inside a quotes.
?0 "What's your name?"
"Hi $0!"
Currently, it's able to ask a question then show the possible options to select, on the basis of which it branches the code flow.
"Select an option -" {
"First" => {
"You selected the first branch!"
}
"Second" => {
"You selected the second branch!"
}
}