ch12ex09.pro

来自「prolog,人工智能推理程序,运行环境prolog」· PRO 代码 · 共 26 行

PRO
26
字号
/*
   Turbo Prolog 2.0 Chapter 12, Example Program 9
   
   Copyright (c) 1986, 88 by Borland International, Inc
   
*/
   
domains
   file = myfile

predicates
   readloop

goal
   write("this program reads your input and writes it to TRYFILE.ONE\n"),
   openwrite(myfile, "tryfile.one"),
   writedevice(myfile),
   readloop,
   closefile(myfile),
   writedevice(screen),
   write("Your input has been transferred to the file tryfile.one").

clauses
   readloop:-readchar(X), X<>'#',!, write(X), readloop.
   readloop.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?