Skip to content

Can compile all the samples in 明義第一, 變數第二, 算術第三, 決策第四 and 循環第五.

License

Notifications You must be signed in to change notification settings

sozysozbot/wenyan-to-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wenyan-to-rust

Finished 變數第二.

samples

test006.wy

有數三。名之曰「甲」。
為是「甲」遍。
	吾有一言。曰「「問天地好在。」」。書之。
云云。

is compiled to

fn main() {
    let JIA3 = 3.0;
    let mut _rand1 = 0.0;
    while _rand1 < JIA3 {
        let _ans1 = "問天地好在。";
        println!("{}", _ans1);
        _rand1 += 1.0;
    }
}

test007.wy

吾有三數。曰三。曰九。曰七。名之曰「甲」。書之。
吾有三數。曰三。曰九。曰七。名之曰「乙」。曰「丙」。書之。
吾有三數。曰三。曰九。曰七。名之曰「丁」。曰「戊」。曰「己」。書之。
吾有三數。曰三。曰九。名之曰「庚」。曰「辛」。曰「壬」。曰「癸」。書之。
fn main() {
    let JIA3 = 3.0;
    let _ans1 = 9.0;
    let _ans2 = 7.0;
    println!("{} {}", _ans1, _ans2);
    let YI3 = 3.0;
    let BING3 = 9.0;
    let _ans3 = 7.0;
    println!("{}", _ans3);
    let DING1 ZHENG1 = 3.0;
    let WU4 = 9.0;
    let JI3 = 7.0;
    println!("");
    let GENG1 = 3.0;
    let XIN1 = 9.0;
    let REN2 = 0.0;
    println!("");
}

test014.wy

吾有一數。曰三。名之曰「甲」。
吾有一言。曰「「問天地好在。」」。書之。

昔之「甲」者。今四是矣。
fn main() {
    let mut JIA3 = 3.0;
    let _ans1 = "問天地好在。";
    println!("{}", _ans1);
    JIA3 = 4.0;
}

test027.wy

加一以三。加二以三。減其以其。
加一以三。加二以三。減其於其。
fn main() {
    let _ans1 = 1.0 + 3.0;
    let _ans2 = 2.0 + 3.0;
    let _ans3 = _ans2 - f64::NAN;
    let _ans4 = 1.0 + 3.0;
    let _ans5 = 2.0 + 3.0;
    let _ans6 = _ans5 - f64::NAN;
}

todo

  • println! the numbers in Hanzi

About

Can compile all the samples in 明義第一, 變數第二, 算術第三, 決策第四 and 循環第五.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published