1.安装io解释器
从http://iolanguage.org/下载binaries,解压后运行.exe
运行io.exe,发现缺少libgcc_s_dw2-1.dll,google之,从http://www.dll-files.com/dllindex/dll-files.shtml?libgcc_s_dw2-1 找到下载,放到和io.exe一个文件夹下,之后就顺利运行Io解释器了。
2.从文件运行Io程序
google, run io from file 后,找到http://en.wikibooks.org/wiki/Io_Programming 以下内容,If you want to write code to be reused, simply put it in a text file and run it withio <filename>
, where <filename> is the name of the file you use.
新建文件run_from_file.io,键入以下代码:
x := 1
y := 2
writeln("x is ", x)
writeln("y is ", y)
x = x + y
writeln("x + y = ", x)
控制台下键入:io run_from_file.io
显示:
x is 1
y is 2
x + y = 3
notice: If you noticed, I used a .io file extension. This is in no way mandated, it is merely a convention. Something happened differently this time then when we did it from a file, if you noticed. Unlike before, we didn't see what each function returned. Instead, we only saw what was explicitly output bywrite
.