当前位置:首页 >时尚 >用于写交互式小说的 Inform 7 编程语言正式开源 在结构上注重空行和缩进

用于写交互式小说的 Inform 7 编程语言正式开源 在结构上注重空行和缩进

2024-06-14 01:46:23 [百科] 来源:避面尹邢网

用于写交互式小说的用于言正源 Inform 7 编程语言正式开源

作者:罗奇奇 开源 Inform 7 是一种使用自然语言语法创建交互式小说的编程语言,曾多次跻身 TIOBE 指数编程语言前 100 之列。写交小说目前,互式Inform 7 编程语言及其组件已正式宣布在 GitHub 上基于 Artistic License 开源。程语

Inform 7 是式开一种使用自然语言语法创建交互式小说的编程语言,曾多次跻身 TIOBE 指数编程语言前 100 之列。用于言正源目前,写交小说Inform 7 编程语言及其组件已正式宣布在 GitHub 上基于 Artistic License 开源。互式

Inform 本身是程语一种用于制作交互式小说的编程语言和设计系统,最初由 Graham Nelson 于 1993 年创建。式开 而 Inform 7 诞生于 2006 年 4 月 ,用于言正源 基于基础的写交小说 Inform 作了进一步抽象,使编译器能进一步推断句子的互式含义。

用于写交互式小说的 Inform 7 编程语言正式开源 在结构上注重空行和缩进

用于写交互式小说的 Inform 7 编程语言正式开源 在结构上注重空行和缩进

Inform 7 由三个主要部分组成:专门用于测试交互式小说的程语开发工具 Inform 7 IDE 、用于编译语言的式开 Inform 7 编译器,以及构成 Inform 7 核心库的“标准规则”。

用于写交互式小说的 Inform 7 编程语言正式开源 在结构上注重空行和缩进

Inform 7 被广泛用于文学写作、游戏行业原型制作工具等场景,它使用自然语言,并借鉴语言学和文学编程的思想,而代码语句则采用完整句子的形式,在结构上注重空行和缩进。下面是一段代码示例:

"Hello Deductible" by "I.F. Author"

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 is in 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 仓库包含大量基础组件、资源文档、代码示例,感兴趣的朋友可以前去了解。

本文转自OSCHINA

本文标题:用于写交互式小说的 Inform 7 编程语言正式开源

本文地址:https://www.oschina.net/news/193544/inform-7-open-source

责任编辑:未丽燕 来源: 开源中国 Inform 7开源自然语言

(责任编辑:热点)

    推荐文章
    热点阅读