DotMars 版 Hello World
DotMars 已經(jīng)具有初步的樣子了,特別發(fā)帖慶祝。
DotMars 第一個(gè)范例程序(dotmars/samples/io/console.d):
D 代碼
module samples.io.console;
import dotmars.io.console;
void main()
{
class Foo {
override char[] toString() {
return "Greeting!";
}
}
Console.writeLine("Hello World!");
Console.writeLineFormatted("Format object: {0}", new Foo);
Console.writeLineFormatted("Format float: PI={0:D4}", 3.1415926);
Console.writeLineFormatted("String & Integers: {2} {0:X} {1}", 0xFFFF, 123456, "Console");
Console.writeLineFormatted("Aligned String: =={0, 10}==", "DotMars");
}
編譯:
安裝配置好 DSSS
從 SVN 里下載代碼: svn export http://dotmars.googlecode.com/svn/trunk/ dotmars
進(jìn)入 dotmars 目錄,執(zhí)行 dsss build 和 dsss install
進(jìn)入 samples 目錄,執(zhí)行 dsss build
執(zhí)行 dotmars/samples/io 目錄下的 console.exe(Windows) 或 console(Linux).
Enjoy It!
更多信息請(qǐng)登陸http://61.191.27.74:802/ 最后,歡迎加入http://61.191.27.74:802/的會(huì)員
安徽新華電腦學(xué)校專(zhuān)業(yè)職業(yè)規(guī)劃師為你提供更多幫助【在線咨詢(xún)】