手把手教你学懂Move语言_打印Hello World
部署环境 powershell运行

 我们发现,生成了三个文件夹及一个文件
scripts文件夹存放脚本文件
source文件夹存放源码
tests文件夹存放测试代码
Move.toml为配置文件
我们发现,生成了三个文件夹及一个文件
scripts文件夹存放脚本文件
source文件夹存放源码
tests文件夹存放测试代码
Move.toml为配置文件生成账户信息

编写代码 在Source文件夹中创建hello.move文件
module Lesson1::HelloWorld{
    use std::debug::print;
    use std::string::utf8;
    #[test]
    fun test_hello_world(){
       print(&utf8(b"Hello World"));    //& var -->Read only &mut var read write
    }
}测试运行 测试通过 成功打印Hello World信息

 
                如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!