可写交互式小说,Inform 7 正式开源
文 | 罗奇奇 出品 | OSC开源社区
Inform 7 是一种使用自然语言语法创建交互式小说的编程语言,曾多次跻身 TIOBE 指数编程语言前 100 之列。目前,Inform 7 编程语言及其组件已正式宣布在 GitHub 上基于 Artistic License 开源。
Inform 本身是一种用于制作交互式小说的编程语言和设计系统,最初由 Graham Nelson 于 1993 年创建。而 Inform 7 诞生于 2006 年 4 月 , 基于基础的 Inform 作了进一步抽象,使编译器能进一步推断句子的含义。
Inform 7 由三个主要部分组成:专门用于测试交互式小说的开发工具 Inform 7 IDE 、用于编译语言的 Inform 7 编译器,以及构成 Inform 7 核心库的“标准规则”。
Inform 7 被广泛用于文学写作、游戏行业原型制作工具等场景,它使用自然语言,并借鉴语言学和文学编程的思想,而代码语句则采用完整句子的形式,在结构上注重空行和缩进。下面是一段代码示例:
The story headline
is"An Interactive Example".
The Living Room
is a room.
"A comfortably furnished living room."The Kitchen
is north
of the Living Room.
The Front Door
is south
of the Living Room.
The Front Door
is a door. The Front Door
is closed
and locked.
The insurance salesman
is a man
in the Living Room. The description
is"An insurance salesman in a tacky polyester suit. He seems eager to speak to you." Understand
"man"as the insurance salesman.
A briefcase
is carried
by the insurance salesman. The description
is"A slightly worn, black briefcase." Understand
"case"as the briefcase.
The insurance paperwork
isin the briefcase. The description
is"Page after page of small legalese." Understand
"papers"or"documents"or"forms"as the paperwork.
Instead
of listening to the insurance salesman:
say
"The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you.";
move the insurance paperwork to the player.
Inform 本身是一个软件,但开源的并不是单个程序,而是程序和资源的集合,目前 Inform 7 的 GitHub 仓库包含大量基础组件、资源文档、代码示例,感兴趣的朋友可以前去了解。
仓库地址:https://github.com/ganelson/inform
官方站点:www.linuxprobe.com
Linux命令大全:www.linuxcool.com
刘遄老师QQ:5604241
Linux技术交流群:2261840
(新群,火热加群中……)
想要学习Linux系统的读者可以点击"阅读原文"按钮来了解书籍《Linux就该这么学》,同时也非常适合专业的运维人员阅读,成为辅助您工作的高价值工具书!
阅读原文 关键词
系统
程序
句子
交互式小说
代码示例
最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。