Click here to Skip to main content
16,011,804 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Urgent Database issue Pin
Yulianto.3-Oct-04 15:26
Yulianto.3-Oct-04 15:26 
Generalpassword in c++ Pin
Anonymous25-Sep-04 5:30
Anonymous25-Sep-04 5:30 
GeneralRe: password in c++ Pin
HalfWayMan25-Sep-04 8:15
HalfWayMan25-Sep-04 8:15 
GeneralRe: password in c++ Pin
David Crow27-Sep-04 10:13
David Crow27-Sep-04 10:13 
GeneralMSDN000.COL error Pin
berko400025-Sep-04 4:31
berko400025-Sep-04 4:31 
GeneralRe: MSDN000.COL error Pin
HalfWayMan25-Sep-04 8:21
HalfWayMan25-Sep-04 8:21 
GeneralRe: MSDN000.COL error Pin
berko400025-Sep-04 8:45
berko400025-Sep-04 8:45 
Generali need to know how use keyboard arrows and then input(to use it in the magic square problem) Pin
hifnawi25-Sep-04 3:34
susshifnawi25-Sep-04 3:34 
i have this problem which is the magic square. i need to know how to use the keyboards arrows in the program like he says. and i only can put number "1" and "2" in their right place can't get the equations for other numbers.
the prompt is:
A magic square is an n*n matrix in which each of the integers 1,2,3…n^2 appears exactly once and all column sums, row sums, and diagonal sums are equal. For example, the following is a 5*5 magic square in which all rows, columns and diagonals add upto 65. The magic number can be calculated according to the following equation : Magic = Sum (1..n^2)/n.


17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9



The following is a procedure for constructing an n*n magic square for any odd integer n. Place 1 in the middle of the top row. Then after integer k has been placed, move up one row and one column to the right to place the next integer k+1, unless one of the following occurs:
• If a move takes you above the top row in the jth column, move to the bottom of the jth column and place k+1 there
• If a move takes you outside to the right of the square in the ith row, place k+1 in the ith row at the left side
• If a move takes you to an already filled square or if you move out of the square at the upper right-hand corner, place k+1 immediately below k.



Write a program to construct n*n magic square for any odd value of n. Your program should provide the facility for the user to input the numbers in any desired position (given it is free). Your program should check the user’s input to verify that it results into a magic square. If this condition is valid you congratulate the user, otherwise you generate the right answer for the user. The user is allowed to play the game as many times as he/she wants, when the user chooses to end the puzzle, your program should tell him his score (number of times he managed to solve the puzzle/number of games).

Input
Max dimensions of the array
The user will then play the game by placing numbers from 1..n^2 on the board

Output
Solution of the puzzle in each time the user chooses to play
User’s percentage


GeneralRe: i need to know how use keyboard arrows and then input(to use it in the magic square problem) Pin
Archer28225-Sep-04 8:25
Archer28225-Sep-04 8:25 
GeneralConverting to System::Object _gc * _gc * Pin
Mirdous25-Sep-04 1:36
Mirdous25-Sep-04 1:36 
GeneralAlternative for while loop in threads Pin
ledallam25-Sep-04 1:32
ledallam25-Sep-04 1:32 
GeneralRe: Alternative for while loop in threads Pin
Andrzej Markowski25-Sep-04 4:59
Andrzej Markowski25-Sep-04 4:59 
GeneralRe: Alternative for while loop in threads Pin
ledallam27-Sep-04 20:51
ledallam27-Sep-04 20:51 
GeneralRe: Alternative for while loop in threads Pin
Andrzej Markowski28-Sep-04 7:40
Andrzej Markowski28-Sep-04 7:40 
GeneralRe: Alternative for while loop in threads Pin
ledallam28-Sep-04 18:09
ledallam28-Sep-04 18:09 
GeneralRe: Alternative for while loop in threads Pin
JimmyRopes25-Sep-04 16:51
professionalJimmyRopes25-Sep-04 16:51 
GeneralThread - check continously Pin
ledallam25-Sep-04 0:25
ledallam25-Sep-04 0:25 
GeneralRe: Thread - check continously Pin
Brad Bruce25-Sep-04 1:21
Brad Bruce25-Sep-04 1:21 
GeneralRe: Thread - check continously Pin
JimmyRopes25-Sep-04 4:59
professionalJimmyRopes25-Sep-04 4:59 
QuestionWindow class in Dll. Help me to find the problem ? Pin
AlexanderKhilko25-Sep-04 0:22
AlexanderKhilko25-Sep-04 0:22 
GeneralOpen Dialog problem Pin
Plons24-Sep-04 23:27
Plons24-Sep-04 23:27 
GeneralRe: Open Dialog problem Pin
Gary R. Wheeler25-Sep-04 2:33
Gary R. Wheeler25-Sep-04 2:33 
GeneralRe: Open Dialog problem Pin
Plons26-Sep-04 5:29
Plons26-Sep-04 5:29 
Generalhidding a file for good Pin
gamitech24-Sep-04 23:27
gamitech24-Sep-04 23:27 
GeneralRe: hidding a file for good Pin
Brian Delahunty25-Sep-04 0:12
Brian Delahunty25-Sep-04 0:12 

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.