implicit none integer maxmoves,maxnode parameter (maxnode=140) parameter (maxmoves=500) c character*80 long(maxnode) c integer llong(maxnode) character*80 short(maxnode) integer lshort(maxnode) character*90 line integer maxverbs parameter(maxverbs=15) integer move(maxmoves,maxverbs) integer nch,n,node,nnodes,nmoves character*12 filenm,link,last integer k,j,lnode c== open(unit=2,file='text.txt',status='old') read (2,100) nch,line 100 format(q,a) read(line,*) n if (n.ne.1) stop'bad section number' c do k=1,maxnode do k=1,10000 read (2,100) nch,line n=index(line,',') if (n.eq.0) n=nch+1 nnodes = node c read(line(1:n-1),*),node read(line(1:n-1),*),node if (node.lt.0) goto 10 c long(node)=line(n+1:nch) c llong(node)=nch-n enddo 10 type *,'read ',nnodes,' nodes' read (2,100) nch,line read(line,*) n if (n.ne.2) stop'bad section number 2' do k=1,maxnode read (2,100) nch,line n=index(line,',') if (n.eq.0) n=nch+1 read(line(1:n-1),*),node if (node.lt.0) goto 20 short(node)=line(n+1:nch) lshort(node)=nch-n enddo 20 read (2,100) nch,line read(line,*) n if (n.ne.3) stop'bad section number 3' do k=1,maxmoves read (2,100) nch,line read(line,*) n if (n.lt.0) goto 30 read(line,*) (move(k,j),j=1,maxverbs) nmoves = k enddo 30 close(unit=2) k=1 open(unit=2,file='text.txt',status='old') read (2,100) nch,line read(line,*) n if (n.ne.1) stop'bad section number' read (2,100) nch,line n=index(line,',') if (n.eq.0) n=nch+1 do node=1,nnodes write(filenm,200) node 200 format('node',i3.3,'.html') type *,'Doing node',node open(unit=3,status='new',file=filenm,carriagecontrol='list') write(3,*)'' write(3,*)'' write(3,*)'' write(3,*)'' if (lshort(node).gt.0) 1 write(3,*)'',short(node)(1:lshort(node)),'' write(3,*)'' write(3,*)'' 65 read(line(1:n-1),*),lnode if (lnode.ne.node) goto 60 write(3,*)line(n+1:nch) read (2,100) nch,line n=index(line,',') if (n.eq.0) n=nch+1 goto 65 60 write(3,*)'

' if (move(k,1).ne.node) stop'node phase in move' write(3,*)'


' ! horizontal line 45 last=link if (move(k,3).gt.nnodes) then write(3,*)'' type *,'special destination ',move(k,3) endif write(link,200) move(k,3) if (move(k,2).ne.0) write(3,*)'' do j=4,10 if (move(k,j).eq.1) write(3,*) 1 'OK ' if (move(k,j).eq.3) write(3,*) 1 'Enter ' if (move(k,j).eq.4) write(3,*) 1 'Upstairs ' if (move(k,j).eq.5) write(3,*) 1 'Downstairs ' if (move(k,j).eq.7) write(3,*) 1 'Forward ' if (move(k,j).eq.8) write(3,*) 1 'Back ' if (move(k,j).eq.11) write(3,*) 1 'Exit ' if (move(k,j).eq.19) write(3,*) 1 'In ' if (move(k,j).eq.29) write(3,*) 1 'Up ' if (move(k,j).eq.30) write(3,*) 1 'Down ' if (move(k,j).eq.36) write(3,*) 1 'Left ' if (move(k,j).eq.37) write(3,*) 1 'Right ' if (move(k,j).eq.43) write(3,*) 1 'East ' if (move(k,j).eq.44) write(3,*) 1 'West ' if (move(k,j).eq.45) write(3,*) 1 'North ' if (move(k,j).eq.46) write(3,*) 1 'South ' if (move(k,j).eq.47) write(3,*) 1 'NorthEast ' if (move(k,j).eq.48) write(3,*) 1 'SouthEast ' if (move(k,j).eq.49) write(3,*) 1 'SouthWest ' if (move(k,j).eq.50) write(3,*) 1 'NorthWest ' enddo !j k=k+1 c write(3,*)'
' if (move(k,1).ne.node) goto 50 goto 45 50 write(3,*)'' write(3,*)'' close(unit=3) enddo ! node end