Click here to Skip to main content
15,912,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: parsing C++ header file Pin
Hamid_RT9-Nov-07 5:18
Hamid_RT9-Nov-07 5:18 
AnswerRe: parsing C++ header file Pin
Michael Dunn8-Nov-07 21:45
sitebuilderMichael Dunn8-Nov-07 21:45 
GeneralRe: parsing C++ header file Pin
DevMentor.org8-Nov-07 22:05
DevMentor.org8-Nov-07 22:05 
GeneralRe: parsing C++ header file Pin
toxcct9-Nov-07 3:13
toxcct9-Nov-07 3:13 
AnswerRe: parsing C++ header file Pin
Bram van Kampen10-Nov-07 14:43
Bram van Kampen10-Nov-07 14:43 
GeneralRe: parsing C++ header file Pin
DevMentor.org10-Nov-07 15:00
DevMentor.org10-Nov-07 15:00 
Question5Queens/5Knights on 8x8 board Pin
Ramper8-Nov-07 15:12
Ramper8-Nov-07 15:12 
AnswerRe: 5Queens/5Knights on 8x8 board Pin
Luc Pattyn8-Nov-07 17:47
sitebuilderLuc Pattyn8-Nov-07 17:47 
Hi,

I did not study your code in detail, but have two remarks.

your code would be (more) readable when you:
- show it inside PRE tags (they preserve formatting, in particular indentation)
- (if possible) put opening brackets on the right of the previous line (which most
people don't do, I prefer it since it allows for more useful code lines per screen)

your code would be a lot simpler if you would use a one-dimensional board[64] array
(i.e. concatenating the eight rows) it would avoid a lot of for loops.
For attack checking, you would have to convert the linear index into a row/col pair
which is simply a divide/modulo 8 operation (two preprocessor macros can come in handy here).

Smile | :)



Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google


AnswerRe: 5Queens/5Knights on 8x8 board Pin
David Crow9-Nov-07 4:32
David Crow9-Nov-07 4:32 
QuestionMatrix Multiplication Pin
7.3DIESEL8-Nov-07 13:57
7.3DIESEL8-Nov-07 13:57 
AnswerRe: Matrix Multiplication Pin
Nelek8-Nov-07 21:47
protectorNelek8-Nov-07 21:47 
QuestionRDTSC Pin
hxhl958-Nov-07 11:37
hxhl958-Nov-07 11:37 
AnswerRe: RDTSC Pin
Mark Salsbery8-Nov-07 12:37
Mark Salsbery8-Nov-07 12:37 
Questionvariable solution compiles, but I can't get at value: [modified] Pin
e40s8-Nov-07 11:01
e40s8-Nov-07 11:01 
AnswerRe: variable solution compiles, but I can't get at value: Pin
Llasus8-Nov-07 12:53
Llasus8-Nov-07 12:53 
GeneralRe: variable solution compiles, but I can't get at value: Pin
e40s9-Nov-07 4:30
e40s9-Nov-07 4:30 
AnswerOfftopic Pin
Nelek8-Nov-07 21:39
protectorNelek8-Nov-07 21:39 
GeneralRe: Offtopic Pin
e40s9-Nov-07 5:14
e40s9-Nov-07 5:14 
QuestionRe: variable solution compiles, but I can't get at value: Pin
David Crow9-Nov-07 4:39
David Crow9-Nov-07 4:39 
AnswerRe: variable solution compiles, but I can't get at value: [modified] Pin
e40s9-Nov-07 5:02
e40s9-Nov-07 5:02 
GeneralRe: variable solution compiles, but I can't get at value: Pin
David Crow9-Nov-07 5:34
David Crow9-Nov-07 5:34 
GeneralRe: variable solution compiles, but I can't get at value: [modified] Pin
e40s9-Nov-07 6:03
e40s9-Nov-07 6:03 
GeneralRe: variable solution compiles, but I can't get at value: Pin
David Crow9-Nov-07 6:20
David Crow9-Nov-07 6:20 
GeneralRe: variable solution compiles, but I can't get at value: [modified] Pin
e40s9-Nov-07 6:36
e40s9-Nov-07 6:36 
GeneralRe: variable solution compiles, but I can't get at value: Pin
David Crow9-Nov-07 6:40
David Crow9-Nov-07 6:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.