Questo sito contribuisce alla audience di

WORDSNAKE

Un programma eseguibile che riarrangia una lista di parole in modo che presentino la massima sovrapposizione

Sia data una lista di parole WORDSNAKE prova ad organizzarla in una
lista in modo che la conclusione di una parola abbia sovrapposizione massima con
l’inizio della parola seguente. L’intera lista è denominata “un wordsnake„ ed è
notata quadrando le sovrapposizioni di ogni accoppiamento successivo ed
aggiungendole.

Usage

wordsnake wordlist
reads wordlist, a file containing a list of words, one per line, to
be made into a wordsnake.

Reference:

Dennis Shasha,
Wordsnakes,
Dr Dobb’s Journal,
July 2000, pages
143-144.

Source Code:

wordsnake.f90, the source code;
wordsnake.csh, commands to compile and load the source code;

Examples and Tests:

wordsnake.inp, a sample wordlist;
wordsnake.out, output from the command “wordsnake wordsnake.inp >
wordsnake.out”;

List of Routines:

MAIN is the main program for WORDSNAKE.
FILE_RECORD_COUNT counts the number of records in a file.
FILE_RECORD_READ reads the records in a file.
GET_UNIT returns a free FORTRAN unit number.
I4_MODP returns the nonnegative remainder of integer division.
I4_RANDOM returns a random integer in a given range.
I4_SWAP switches two integer values.
I4_SWAP3 swaps three integer values.
I4_UNSWAP3 unswaps three integer values.
I4_WRAP forces an integer to lie between given limits by wrapping.
I4VEC_IDENTITY sets an integer vector to the identity vector A(I)=I.
LOWER returns a lowercase version of a string.
OVERLAP_TABLE computes a table of the overlap between pairs of words.

PERM_RANDOM selects a random permutation of N objects.
S_OVERLAP determines the overlap between two strings.
TIMESTAMP prints the current YMDHMS date as a time stamp.
UPPER returns an uppercase version of a string.
WORDSNAKE seeks a high scoring permutation of a set of words.
WORDSNAKE_PRINT prints a wordsnake.
WORDSNAKE_SCORE computes the score for a given wordsnake.
WORDSNAKE_SEARCH_GREEDY constructs a wordsnake using a greedy
algorithm.
WORDSNAKE_SEARCH_INSERT tries to improve the score by inserting a
word.
WORDSNAKE_SEARCH_SWAP2 tries to improve the score by swapping 2
words.
WORDSNAKE_SEARCH_SWAP3 tries to improve the score by swapping 3
words.
WORDSNAKE_SEARCH_TRANSPOSE tries to improve the score using
transpositions.

PER CONSULTARE LA RISORSA CLICCARE SUL LINK SEGUENTE:

href="http://people.scs.fsu.edu/~burkardt/f_src/wordsnake/wordsnake.html" TARGET=_BLANK>WORDSNAKE