ex1109.f90

来自「Fortran 95程序设计【彭国伦】第11章」· F90 代码 · 共 36 行

F90
36
字号
module NewGraphLib
  use TextGraphLib
  implicit none
contains
  subroutine OutputToFile(filename)
    implicit none
    character(len=*), intent(in) :: filename
	character(len=10) :: fmt="(xxxA)"
	integer :: i

	if ( .not. allocated(screen) ) return
	open(10,file=filename,status="replace")
    write(fmt(2:4), "(I3.3)") ScreenWidth ! 设定输出格式
    do i=1, ScreenHeight
	  write(10, fmt) screen(i,:)
    end do
	close(10)

	return
  end subroutine
end module

program main
  use NewGraphLib
  implicit none
  
  call SetScreen(20,20)
  call ClearScreen()
  call DrawCircle(10,10,8)
  call DrawLine(14,6, 6,14)
  call UpdateScreen()
  call OutputToFile("test.txt")

  stop
end program

⌨️ 快捷键说明

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