![]() |
|
#1
|
|||
|
|||
Class Function Problems...Well this is the first thing i've (attempted to) program in c++, a crossword solver that will take the shape of a crossword and all of the words in the crossword and solve it using the length of the words and the intersections between word slots.
Right now, i'm stuck at the part where the program looks at the shape of the crossword and determines where the "word slots" are, eg. 1 down, 3 across, whatever. I'm attempting this through the creation of the classes crosswordRaw, which hold the coordinates of all of the activated "cells" in an array, coordinate, which holds an x and y coordinate, and wordSlot, which will eventually hold a linked list of the cells the word slot contains. Once i get what i have working, i'll create an intersection class, or a way for the linked lists of the wordSlots to refer to each other. There are also the functions wordStarterChecker, which checks an activated cell on the crossword and determines if it starts a wordSlot, wordSlotProcessor, which counts the length of a wordSlot and determines the intersections it holds, and two others which i'm not having problems with (yet...). My problems occur in a couple of places, wordSlot: CPP / C++ / C Code:
wordSlotProcessorVert: CPP / C++ / C Code:
These warning don't appear for the horizontal version, though it's basically the same code, or maybe the compiler just never checked it. Here's the coordinate class for reference. CPP / C++ / C Code:
There's probably something extremely obvious i'm missing, but i wouldn't know. I'm running Ubuntu Karmic, using Code::Blocks and the default GCC compiler (i think). I've attached a .txt file with the entire code and the errors/warnings. |
|||
|
#2
|
|||
|
|||
Re: Class Function Problems...Quote:
Here's a rundown of the code you attached. I might miss some things. CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
Next there's this: CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
Lastly, there are some minor typos. My recommendation would be what is often recommended: Code a little, compile a little, test a little. It is quite obvious you coded a lot and compiled a lot. |
|
#3
|
|||
|
|||
Re: Class Function Problems...Well thanks, I'll try this out. I didn't expand on someone else's code though, i just wrote half of it and got it working, and then put it away for a while and took a second hack at it, and yeah lack of knowledge, first time trying and that's why i posted it up.
|
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| run script command on ns2.26 | newbie06 | Computer Software Forum - Linux | 66 | 16-Jan-2010 10:53 |
| Compiling C btrieve programs in VS 2005 | emanresu | C Programming Language | 1 | 16-Nov-2009 03:19 |
| Problem executing nam-1.13 | RodolfoAlvizu | Computer Software Forum - Linux | 20 | 28-Feb-2009 15:23 |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 19:23 |
| Box Class, need help again :( | TransformedBG | C++ Forum | 7 | 13-Nov-2006 15:11 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The