crossword puzzle question

hi everybody~
i am writing a crossword puzzle , but i found some problems in writing the program.
When i type a answer into a string
and then i convert it to character,and check it
but how to show to answer in the screen only,
and other character are cover by a character X??
I use a array to show the answer only,but i always fail..
Does anyone have a good sample?
if have, please send to denny923@rediffmail.com

Thank you

Comments

  • : hi everybody~
    : i am writing a crossword puzzle , but i found some problems in writing the program.
    : When i type a answer into a string
    : and then i convert it to character,and check it
    : but how to show to answer in the screen only,
    : and other character are cover by a character X??
    : I use a array to show the answer only,but i always fail..
    : Does anyone have a good sample?
    : if have, please send to denny923@rediffmail.com
    :
    : Thank you
    :
    Here is a small untested example:
    [code]
    var
    Answers: array[1..5, 1..5] of char;
    x, y: integer;
    EnteredAnswer: string;
    begin
    { Initialize the board }
    for x := 1 to 5 do
    for y := 1 to 5 do
    Answers[x, y] := 'x';
    { Get an answer from the user <== Own code}
    EnteredAnswer := 'hello';
    { Add the answer into the array }
    for x := 1 to 5 do
    Answers[x, 2] := EnteredAnswer[x];
    { Show the results }
    for y := 1 to 5 do
    begin
    for x := 1 to 5 do
    write(Answers[x, y], ' ');
    writeln;
    end;
    end.
    [/code]
    The results of this code should now be:
    [code]
    x x x x x
    h e l l o
    x x x x x
    x x x x x
    x x x x x
    [/code]
    If a second answer is world (entered vertically at column 5):
    [code]
    EnteredAnswer := 'world';
    { Add the answer into the array }
    for y := 1 to 5 do
    Answers[5, y] := EnteredAnswer[y];
    [/code]
    The results of this code would be:
    [code]
    x x x x w
    h e l l o
    x x x x r
    x x x x l
    x x x x d
    [/code]
    If you want to reset the board, simply reinitialize the board and you're done.
  • : : hi everybody~
    : : i am writing a crossword puzzle , but i found some problems in writing the program.
    : : When i type a answer into a string
    : : and then i convert it to character,and check it
    : : but how to show to answer in the screen only,
    : : and other character are cover by a character X??
    : : I use a array to show the answer only,but i always fail..
    : : Does anyone have a good sample?
    : : if have, please send to denny923@rediffmail.com
    : :
    : : Thank you
    : :
    : Here is a small untested example:
    : [code]
    : var
    : Answers: array[1..5, 1..5] of char;
    : x, y: integer;
    : EnteredAnswer: string;
    : begin
    : { Initialize the board }
    : for x := 1 to 5 do
    : for y := 1 to 5 do
    : Answers[x, y] := 'x';
    : { Get an answer from the user <== Own code}
    : EnteredAnswer := 'hello';
    : { Add the answer into the array }
    : for x := 1 to 5 do
    : Answers[x, 2] := EnteredAnswer[x];
    : { Show the results }
    : for y := 1 to 5 do
    : begin
    : for x := 1 to 5 do
    : write(Answers[x, y], ' ');
    : writeln;
    : end;
    : end.
    : [/code]
    : The results of this code should now be:
    : [code]
    : x x x x x
    : h e l l o
    : x x x x x
    : x x x x x
    : x x x x x
    : [/code]
    : If a second answer is world (entered vertically at column 5):
    : [code]
    : EnteredAnswer := 'world';
    : { Add the answer into the array }
    : for y := 1 to 5 do
    : Answers[5, y] := EnteredAnswer[y];
    : [/code]
    : The results of this code would be:
    : [code]
    : x x x x w
    : h e l l o
    : x x x x r
    : x x x x l
    : x x x x d
    : [/code]
    : If you want to reset the board, simply reinitialize the board and you're done.
    :

    Thank you very much for your help^^"

  • : : : hi everybody~
    : : : i am writing a crossword puzzle , but i found some problems in writing the program.
    : : : When i type a answer into a string
    : : : and then i convert it to character,and check it
    : : : but how to show to answer in the screen only,
    : : : and other character are cover by a character X??
    : : : I use a array to show the answer only,but i always fail..
    : : : Does anyone have a good sample?
    : : : if have, please send to denny923@rediffmail.com
    : : :
    : : : Thank you
    : : :
    : : Here is a small untested example:
    : : [code]
    : : var
    : : Answers: array[1..5, 1..5] of char;
    : : x, y: integer;
    : : EnteredAnswer: string;
    : : begin
    : : { Initialize the board }
    : : for x := 1 to 5 do
    : : for y := 1 to 5 do
    : : Answers[x, y] := 'x';
    : : { Get an answer from the user <== Own code}
    : : EnteredAnswer := 'hello';
    : : { Add the answer into the array }
    : : for x := 1 to 5 do
    : : Answers[x, 2] := EnteredAnswer[x];
    : : { Show the results }
    : : for y := 1 to 5 do
    : : begin
    : : for x := 1 to 5 do
    : : write(Answers[x, y], ' ');
    : : writeln;
    : : end;
    : : end.
    : : [/code]
    : : The results of this code should now be:
    : : [code]
    : : x x x x x
    : : h e l l o
    : : x x x x x
    : : x x x x x
    : : x x x x x
    : : [/code]
    : : If a second answer is world (entered vertically at column 5):
    : : [code]
    : : EnteredAnswer := 'world';
    : : { Add the answer into the array }
    : : for y := 1 to 5 do
    : : Answers[5, y] := EnteredAnswer[y];
    : : [/code]
    : : The results of this code would be:
    : : [code]
    : : x x x x w
    : : h e l l o
    : : x x x x r
    : : x x x x l
    : : x x x x d
    : : [/code]
    : : If you want to reset the board, simply reinitialize the board and you're done.
    : :
    :
    : Thank you very much for your help^^"
    :
    :

    it is very useful~ thzz~!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories