⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch12ex11.pro

📁 prolog,人工智能推理程序,运行环境prolog
💻 PRO
字号:
/*
   Turbo Prolog 2.0 Chapter 12, Example Program 11
      
   Copyright (c) 1986, 88 by Borland International, Inc
   
*/
   
domains
   file = input; output

predicates
   convert_file
   repfile(FILE)

goal
   write("Which file do you want convert ?"),
   readln(InputFileName),
   write("What is the name of the output file ?"),
   readln(OutputFileName),
   openread(input, InputFileName),
   readdevice(input), 
   openwrite(output, OutputFileName),
   writedevice(output), 
   convert_file,
   closefile(input),
   closefile(output).

clauses
   convert_file :-
      repfile(input),
      readln(Ln),
      upper_lower(LnInUpper,Ln),          /* converts the string to upprecase */
      write(LnInUpper),nl,
      fail.
   convert_file.

   repfile(_).
   repfile(F):- not(eof(F)),repfile(F).

⌨️ 快捷键说明

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