Re: crossword project works



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





.



Relevant Pages

  • Re: Working with eval
    ... are not giving me any clue on why this is happening: ... error because unquoted strings are one of the 3 features it switches ... set $ans to that number. ... the problem is that as soon as it does eval, it shows a warning ...
    (perl.beginners)
  • Keeps Restarting
    ... I would look in Event Viewer for a clue. ... >My computer keeps restarting without any warning. ... it loads back up it displays an error report saying ' your ...
    (microsoft.public.windowsxp.basics)
  • Re: New squawk in logwatch report?
    ... > something I don't recall seeing previously: ... > WARNING: Kernel Errors Present ... I have no clue. ...
    (Linux-Kernel)
  • Re: Bad Image Checksum comdlg32.dll
    ... I have not a clue why this happens. ... If you are using some third party drivers remove them. ... > This is the first time i have attempted to debug a box. ... > downloaded symbols yet but I am getting a warning that states ...
    (microsoft.public.windowsxp.embedded)
  • Array query...
    ... im struggling to get started on an assignment in that ive ... only just begun c++ & was wondering if anyone might give a clue as to ...
    (alt.comp.lang.learn.c-cpp)