Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
WordFind.FOR (for 16 bit Fortran)

WordFind.FOR (for 16 bit Fortran)

Ratings: (0)|Views: 7 |Likes:
Published by kgrhoads

WordFind.EXE DOS 16 real mode exe SOURCE CODE -- F77

WordFind.EXE DOS 16 real mode exe SOURCE CODE -- F77

More info:

Published by: kgrhoads on Feb 02, 2013
Copyright:Attribution

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

09/17/2013

pdf

text

original

 
** Copyright 2004 Kevin G. Rhoads** Set up for Microsoft Fortran v5.1 (16 bit Fortran)* The two includes provide definitions for command line access* NARGS() and GETARG* and definitions for access to system time and date* GETTIM and GETDAT* These would need to be changed for other F77 compilers.** Nonstandard (in F77) intrinsics used are:* LEN_TRIM, SEED, RAND* These would need to be changed for other F77 compilers.** At present the size of the puzzle square (15 by 15) and the maximum* number of words (36) are hardcoded, updating this is on the to-do* list^H^H^H^H heap. As is handling for manual PRNG seeding, and* better handling of words that don't fit.*$include:'flib.fi'program wordfind$include:'flib.fd'character*1 square(15,15),dotcharacter*1 words(44,15)integer lengths(44)integer size,numwords,nmwordsinteger rand15,randseedcharacter*1 randcharexternal rand15,randchar,filldot,fillrandcharacter*255 filename,hintname,puzlname,argcharacter file*8,path*127,drive*1,ext*3character*38 versioninteger*4 iostatinteger*2 curarg,argstatlogical cmdlineexternal getarg*-----* initialization* init constantsdot = '.'size = 15numwords = 44randseed = 0version = ' Word Find Puzzle Generator v1.000.023'write (*,*) versionwrite (*,*) ' Copyright (c) 2004 Kevin G. Rhoads 'write (*,*) ' All rights reserved.'write (*,*) ' Executable is freely distributable.'write (*,*) ' 'curarg = 1*-----cmdline = (nargs().gt.curarg)9000 continueif (.not.cmdline) thenfilename = 'TESTWRDS.'hintname = 'TEST.HNT'puzlname = 'TEST.PZL'
 
elsecall getarg(curarg,arg,argstat)curarg = curarg + 1drive = ' 'path = ' 'file = ' 'ext = ' 'call fnchk(arg,filename,drive,path,file,ext)ext = 'HNT'call fnovr(filename,hintname,drive,path,file,ext)ext = 'PZL'call fnovr(filename,puzlname,drive,path,file,ext)endif* prepare to read word list -- blank out the word listcall blnkwords(words,lengths,numwords,size)* read word listcall readword(words,lengths,nmwords,numwords,size,filename)write (*,*) ' Read word list, nmwords = ',nmwordswrite (*,*) ' from input file ',filename(1:len_trim(filename))if (nmwords.le.0) goto 9001* extract parameters (if any) from word list* sort word list (big stones first)call sortsize(words,lengths,numwords,size,nmwords)* seed random number generatorcall seedrand(randseed)* prefill array with '.'call filldot(square,size)* write (*,*) ' filldot done '* fill array with wordscall fillword(square,size,words,lengths,nmwords,numwords)* alphbetize word arraycall alphabet(words,lengths,numwords,size,nmwords)* write out .HNTcall writesq(square,size,hintname,words,lengths,numwords,nmwords)write (*,*) ' wrote hint file ',hintname(1:len_trim(hintname))* write (*,*) ' write TEST.HNT done'* replace '.' with random letterscall fillrand(square,size)* write out .PZLcall writesq(square,size,puzlname,words,lengths,numwords,nmwords)write (*,*) ' wrote puzzle file ',puzlname(1:len_trim(puzlname))* write (*,*) ' write TEST.PZL done'* check for another command line arg9001 continuecmdline = (nargs().gt.curarg)if (cmdline) goto 9000stop ' Bye'*-----* 7001 format (1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,* & 1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,* & 1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,* & 1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,* & 1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1,1x,A1)end*-----------------------------------------------------------------------integer*4 function rand15()real value
 
integer i*-----call random(value)i = value*15.0 + 1.0rand15 = ireturnend*-----------------------------------------------------------------------character*1 function randchar()real valueinteger i*-----call random(value)i = value*26.0 + ichar('A')randchar = char(i)returnend*-----------------------------------------------------------------------subroutine filldot(square,size)integer size,i,jcharacter*1 square(size,size),dot*-----dot = '.'do 1 i = 1,sizedo 2 j = 1,sizesquare(i,j) = dot2 continue1 continuereturnend*-----------------------------------------------------------------------subroutine fillrand(square,size)integer size,i,jcharacter*1 square(size,size),dotcharacter*1 randcharexternal randchar*-----dot = '.'do 1 i = 1,sizedo 2 j = 1,sizeif (square(i,j).eq.dot) thensquare(i,j) = randchar()endif2 continue1 continuereturnend*-----------------------------------------------------------------------subroutine blnkwords(words,lengths,numwords,size)integer numwords,sizecharacter*1 words(numwords,size),blankinteger lengths(numwords),i,j*-----blank = ' 'do 1 j = 1,numwordslengths(j) = 0do 2 i = 1,size

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->