Inform 7 是一种使用自然语言语法创建交互式小说的特定领域编程语言。它使用自然语言并借鉴语言学和文学编程的思想,被广泛用作文学写作的媒介、游戏行业的原型制作工具,根据 TIOBE 指数,Inform 曾多次跻身最具影响力的 100 种编程语言之列。
Inform 本身是一个软件,但开源的并不是单个程序,而是程序和资源的集合,Inform 7 由三个主要部分组成:专门用于创作/测试交互式小说的开发工具 Inform 7 IDE 、用于编译语言的 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.
评论