Re: crossword project works
- From: Randy Howard <randyhoward@xxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 12:34:18 GMT
On Tue, 29 Jan 2008 04:18:18 -0600, Malcolm McLean wrote
(in article <Y56dndHwg9PCYAPanZ2dnUVZ8uGdnZ2d@xxxxxx>):
"Malcolm McLean" <regniztar@xxxxxxxxxxxxxx> wrote in message
It's now in pre-alpha.Yoou can see version one on the website. Under "crossword generator" in the
bottom tright hand corner.
No makefile for the C code? That's not very friendly. :)
I hacked up a quick generic makefile to just build all the .c files as
C89 and link them. The errors on my system with gcc 4.0.1 -- using a
much less "verbose" set of command line args than I normally use with
gcc -- are shown below.
It takes a really long time to run with your recommended iteration
count, mainly because of the I/O to the console on each pass, even on
an unloaded 2GHz dual proc system.
I noticed that the generated puzzle (using the recommended cmd line
args from your web page) had some somewhat interesting clues. Namely,
they look suspect, since they seem to be the same (with some weird
syntax tacked on) as the answers, which was surprising. Then I looked
at your "clue file" for the times, and apparently you did that on
purpose.
It seems to handle duplicate clues.
Passing an iteration count of 100, generated output for 1125
iterations, but I didn't investigate further.
Passing an iteration count of 1000, generated output for 2525
iterations.
If you pick small values for height and width (say 4), you just get a
black image and blank clue lists.
Then I gave it a clue file by concatenating the times and biochemistry
clues files then adding in a very few lines up top with some improperly
formed clues (they had one or more extra '/' chars in the clue portion
of the line). It generating a bunch lines looking like this:
***
Parsing ***# clue files from Times crossword
***
Parsing ***this / is a / test / foo
***
Parsing ***
***
Parsing ***and so forth / clue to and so forth
followed by lines for the rest of the data file.
Then it generated a Bus Error on the console and aborted. Before any
of the iteration loop output was displayed. The debug popup that
resulted looked like this:
EXC_BAD_ACCESS(SIGBUS)
KERN_PROTECTION_FAILURE at 0x0000000000000000
Thread 0 Crashed:
0 strlen + 8
1 score + 104
2 anneal + 152
3 crossword + 172
4 main + 820
5 start + 64
So I tried it with only a single line data file, as follows:
his / is a testfoo / clue for foo
simulating someone accidentally joining too lines in a clue file.
I invoked it with defaults except for the -clues, -applet and -iter
20000.
It generated:
Parsing ***this / is a testfoo / clue for foo
***
Parsing ***
***
Parsing ***
***
Parsing ***
***
Parsing ***
***
Parsing ***
***
Parsing ******
0 165.000000
Segmentation fault
Note: The file had only one line. It apparently /tried/ to parse 7
lines, of which 6 didn't even exist, but I get a segfault instead of a
bus error that time. This sort of thing is why having a PPC system
around can be handy.
I suspect there are some invalid assumptions about alignment (bus
error), as well as some failures to validate input, but I didn't spend
any more time on it.
Forgive the line breaks from the posting, I'm not going to bother
reformatting that many. I also tried with C99 options btw, and got
similar results.
gcc -Wall -W -O2 -ansi -pedantic -c -o anneal.o anneal.c
gcc -Wall -W -O2 -ansi -pedantic -c -o cluefile.o cluefile.c
cluefile.c: In function ?floadcluefile¹:
cluefile.c:54: warning: implicit declaration of function ?getline¹
cluefile.c:54: warning: assignment makes pointer from integer without a
cast
cluefile.c:54: warning: suggest parentheses around assignment used as
truth value
cluefile.c: In function ?parseline¹:
cluefile.c:222: warning: implicit declaration of function ?getword¹
cluefile.c:222: warning: assignment makes pointer from integer without
a cast
cluefile.c:222: warning: suggest parentheses around assignment used as
truth value
cluefile.c:224: warning: implicit declaration of function ?makeupper¹
cluefile.c:192: warning: unused parameter ?err¹
gcc -Wall -W -O2 -ansi -pedantic -c -o crossword.o crossword.c
crossword.c: In function ?kill¹:
crossword.c:172: warning: unused parameter ?ptr¹
crossword.c: In function ?copy¹:
crossword.c:188: warning: unused parameter ?ptr¹
crossword.c: In function ?mutate¹:
crossword.c:206: warning: unused parameter ?ptr¹
crossword.c: In function ?greedy¹:
crossword.c:268: warning: comparison between signed and unsigned
gcc -Wall -W -O2 -ansi -pedantic -c -o crosswordtohtml.o
crosswordtohtml.c
crosswordtohtml.c: In function ?printcluelen¹:
crosswordtohtml.c:176: warning: suggest parentheses around assignment
used as truth value
gcc -Wall -W -O2 -ansi -pedantic -c -o dictionary.o dictionary.c
dictionary.c: In function ?extractwords¹:
dictionary.c:28: warning: suggest parentheses around assignment used as
truth value
dictionary.c:31: warning: suggest parentheses around assignment used as
truth value
gcc -Wall -W -O2 -ansi -pedantic -c -o main.o main.c
main.c: In function ?main¹:
main.c:116: warning: implicit declaration of function ?extractwords¹
main.c:116: warning: assignment makes pointer from integer without a
cast
main.c:52: warning: ?cf¹ may be used uninitialized in this function
main.c:48: warning: ?words¹ may be used uninitialized in this function
gcc -Wall -W -O2 -ansi -pedantic -c -o options.o options.c
options.c: In function ?parseoptionsv¹:
options.c:376: warning: comparison between signed and unsigned
gcc -Wall -W -O2 -ansi -pedantic -c -o xmalloc.o xmalloc.c
xmalloc.c: In function ?handler¹:
xmalloc.c:81: warning: unused parameter ?ptr¹
gcc -o prog anneal.o cluefile.o crossword.o crosswordtohtml.o
dictionary.o main.o options.o xmalloc.o
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw
.
- Follow-Ups:
- Re: crossword project works
- From: Malcolm McLean
- Re: crossword project works
- References:
- crossword project works
- From: Malcolm McLean
- Re: crossword project works
- From: Malcolm McLean
- crossword project works
- Prev by Date: Re: Posting Moratorium
- Next by Date: Re: crossword project works
- Previous by thread: Re: crossword project works
- Next by thread: Re: crossword project works
- Index(es):
Relevant Pages
|
|