June 2021
Beginner
344 pages
8h 9m
English
Most computer programs operate in a cycle of accepting input from the user and transforming that into some form of—hopefully useful—output. A calculator without buttons is useless, and a computer program without input is equally limited to always doing the same thing. You used println! in “Hello, World” to output text; you can use read_line() to accept data from the terminal.
In this section, you’ll use the terminal to ask the visitor to type their name and receive the result. Finally, you’ll make use of Rust’s formatting system to print a personalized greeting to the terminal.
When a visitor arrives at your swanky new treehouse, you need to ask them for their name. In Printing Text, you ...
Read now
Unlock full access