Howdy, Stranger!

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

Categories

crossword!!

124»

Comments

  • juice88juice88 Member Posts: 23
    : : i have some questions about crossword ~
    : : Please help me!
    : :
    : : 1) How to set the background colour and text colour in pascal??
    : :
    : : 2) I want to know does pascal has this function??
    : : if i input the right answer in the game
    : : then the colour of text will change to another colour~~
    : : How can do this??
    : :
    : : Suggest the simplest way to me~
    : : THZ~
    : :
    :
    : To set the background colour in Pascal use this: textbackground(colour); {colour is where you have to put your colour which you want } and for text colour use this: textcolor(colour);
    :
    : Yes no.2 can be done in Pascal but I don't know how.
    :
    : Xaser-3
    :
    : I just use write() and GotoXY() to do .~
    :
    :

  • juice88juice88 Member Posts: 23
    : [b][red]This message was edited by juice88 at 2005-1-6 7:45:47[/red][/b][hr]
    : [b][red]This message was edited by juice88 at 2005-1-6 7:45:7[/red][/b][hr]
    : : : : : : : i have some questions about crossword ~
    : : : : : : : Please help me!
    : : : : : : :
    : : : : : : : 1) How to set the background colour and text colour in pascal??
    : : : : : : :
    : : : : : : : 2) I want to know does pascal has this function??
    : : : : : : : if i input the right answer in the game
    : : : : : : : then the colour of text will change to another colour~~
    : : : : : : : How can do this??
    : : : : : : :
    : : : : : : : Suggest the simplest way to me~
    : : : : : : : THZ~
    : : : : : : :
    : : : : : : 1: TextColor() and TextBackground() in the CRT unit.
    : : : : : :
    : : : : : : 2: Set the new textcolor and write the answer again at the same location.
    : : : : : :
    : : : : : THX~
    : : : : : BUT I Have a error200 when i set the text colour.
    : : : : :
    : : : : :
    : : : : :
    : : : : :
    : : : : If you are using TP, have you patched your CRT unit? If not search for CRT patch on google, and install that. It is necessary for fast computers.
    : : : :
    : : : OK!The problem has been solved.
    : : :
    : : : 2)I think this method is not suitable in my idea.
    : : : My idea is like that:
    : : : I had set a display with many letters for the player to choose them.
    : : : If they choose a right letter, it will change colour.
    : : :
    : : : Any other method??
    : : :
    : : : 3)How to set a timer that count down 30 minutes.
    : : :
    : : :
    : : Inc is short for increase, which should be explained in the help files.
    : : ReadText() is designed to get the whole answer in 1 loop, then you can check it and ask the user the next question.
    :
    :
    : But how the program know when should it increase??
    : What is the use of this inc() comment in the crossword??
    :
    : NO~ I want to get each of the letter in loop,then i can check it one by one and move to next letter if the user entered is right.
    :
    : layout
    : [code]
    : ###########################################
    : # # # # # # #
    : # # # # # # #
    : ###########################################
    : [/code]
    : There are 6 boxes, the user need to enter the first letter in the first box and press enter and then check it .If the letter is right ,then (GotoXY) move to next box and enter the second letter......Therefore the coordinateXY of each boxes are different .
    :
    : So how can the function work in this way??
    :
    : :
    :

    ??
  • zibadianzibadian Member Posts: 6,349
    : : [b][red]This message was edited by juice88 at 2005-1-6 7:45:47[/red][/b][hr]
    : : [b][red]This message was edited by juice88 at 2005-1-6 7:45:7[/red][/b][hr]
    : : : : : : : : i have some questions about crossword ~
    : : : : : : : : Please help me!
    : : : : : : : :
    : : : : : : : : 1) How to set the background colour and text colour in pascal??
    : : : : : : : :
    : : : : : : : : 2) I want to know does pascal has this function??
    : : : : : : : : if i input the right answer in the game
    : : : : : : : : then the colour of text will change to another colour~~
    : : : : : : : : How can do this??
    : : : : : : : :
    : : : : : : : : Suggest the simplest way to me~
    : : : : : : : : THZ~
    : : : : : : : :
    : : : : : : : 1: TextColor() and TextBackground() in the CRT unit.
    : : : : : : :
    : : : : : : : 2: Set the new textcolor and write the answer again at the same location.
    : : : : : : :
    : : : : : : THX~
    : : : : : : BUT I Have a error200 when i set the text colour.
    : : : : : :
    : : : : : :
    : : : : : :
    : : : : : :
    : : : : : If you are using TP, have you patched your CRT unit? If not search for CRT patch on google, and install that. It is necessary for fast computers.
    : : : : :
    : : : : OK!The problem has been solved.
    : : : :
    : : : : 2)I think this method is not suitable in my idea.
    : : : : My idea is like that:
    : : : : I had set a display with many letters for the player to choose them.
    : : : : If they choose a right letter, it will change colour.
    : : : :
    : : : : Any other method??
    : : : :
    : : : : 3)How to set a timer that count down 30 minutes.
    : : : :
    : : : :
    : : : Inc is short for increase, which should be explained in the help files.
    : : : ReadText() is designed to get the whole answer in 1 loop, then you can check it and ask the user the next question.
    : :
    : :
    : : But how the program know when should it increase??
    : : What is the use of this inc() comment in the crossword??
    : :
    : : NO~ I want to get each of the letter in loop,then i can check it one by one and move to next letter if the user entered is right.
    : :
    : : layout
    : : [code]
    : : ###########################################
    : : # # # # # # #
    : : # # # # # # #
    : : ###########################################
    : : [/code]
    : : There are 6 boxes, the user need to enter the first letter in the first box and press enter and then check it .If the letter is right ,then (GotoXY) move to next box and enter the second letter......Therefore the coordinateXY of each boxes are different .
    : :
    : : So how can the function work in this way??
    : :
    : : :
    : :
    :
    : ??
    :
    I would use the normal KeyPressed/Readkey combination for that:
    [code]
    repeat
    ch := '';
    repeat
    { Show time to user }
    [red]if CurrentTime > EndTime then[/red]
    Break;
    if KeyPressed then
    ch := ReadKey;
    until ch <> '';
    [red]if CurrentTime > EndTime then[/red]
    Break;
    until ch = AnswerLetter;
    [/code]
    You might want to place this loop into a function with the AnswerLetter as parameter and the user input as result.
    The red if-thens's need some work. These are to ensure that the user runs out of time during the input.
  • juice88juice88 Member Posts: 23
    : : : [b][red]This message was edited by juice88 at 2005-1-6 7:45:47[/red][/b][hr]
    : : : [b][red]This message was edited by juice88 at 2005-1-6 7:45:7[/red][/b][hr]
    : : : : : : : : : i have some questions about crossword ~
    : : : : : : : : : Please help me!
    : : : : : : : : :
    : : : : : : : : : 1) How to set the background colour and text colour in pascal??
    : : : : : : : : :
    : : : : : : : : : 2) I want to know does pascal has this function??
    : : : : : : : : : if i input the right answer in the game
    : : : : : : : : : then the colour of text will change to another colour~~
    : : : : : : : : : How can do this??
    : : : : : : : : :
    : : : : : : : : : Suggest the simplest way to me~
    : : : : : : : : : THZ~
    : : : : : : : : :
    : : : : : : : : 1: TextColor() and TextBackground() in the CRT unit.
    : : : : : : : :
    : : : : : : : : 2: Set the new textcolor and write the answer again at the same location.
    : : : : : : : :
    : : : : : : : THX~
    : : : : : : : BUT I Have a error200 when i set the text colour.
    : : : : : : :
    : : : : : : :
    : : : : : : :
    : : : : : : :
    : : : : : : If you are using TP, have you patched your CRT unit? If not search for CRT patch on google, and install that. It is necessary for fast computers.
    : : : : : :
    : : : : : OK!The problem has been solved.
    : : : : :
    : : : : : 2)I think this method is not suitable in my idea.
    : : : : : My idea is like that:
    : : : : : I had set a display with many letters for the player to choose them.
    : : : : : If they choose a right letter, it will change colour.
    : : : : :
    : : : : : Any other method??
    : : : : :
    : : : : : 3)How to set a timer that count down 30 minutes.
    : : : : :
    : : : : :
    : : : : Inc is short for increase, which should be explained in the help files.
    : : : : ReadText() is designed to get the whole answer in 1 loop, then you can check it and ask the user the next question.
    : : :
    : : :
    : : : But how the program know when should it increase??
    : : : What is the use of this inc() comment in the crossword??
    : : :
    : : : NO~ I want to get each of the letter in loop,then i can check it one by one and move to next letter if the user entered is right.
    : : :
    : : : layout
    : : : [code]
    : : : ###########################################
    : : : # # # # # # #
    : : : # # # # # # #
    : : : ###########################################
    : : : [/code]
    : : : There are 6 boxes, the user need to enter the first letter in the first box and press enter and then check it .If the letter is right ,then (GotoXY) move to next box and enter the second letter......Therefore the coordinateXY of each boxes are different .
    : : :
    : : : So how can the function work in this way??
    : : :
    : : : :
    : : :
    : :
    : : ??
    : :
    : I would use the normal KeyPressed/Readkey combination for that:
    : [code]
    : repeat
    : ch := '';
    : repeat
    : { Show time to user }
    : [red]if CurrentTime > EndTime then[/red]
    : Break;
    : if KeyPressed then
    : ch := ReadKey;
    : until ch <> '';
    : [red]if CurrentTime > EndTime then[/red]
    : Break;
    : until ch = AnswerLetter;
    : [/code]
    : You might want to place this loop into a function with the AnswerLetter as parameter and the user input as result.
    : The red if-thens's need some work. These are to ensure that the user runs out of time during the input.
    :
    I get your point !!
    Am I right??

    [code]
    function UserInput (var AnswerLetter:char;X,Y,A,B:integer): string ;
    var
    TimeLeft,GameStartTime,hint:integer ;
    k:char ;
    UserEntered : boolean;
    begin
    GameStartTime := TimeInMin;
    repeat
    UserInput:='';
    repeat
    TimeLeft:=(3-(TimeInMin-GameStartTime));
    GotoXY(8,34);
    write(TimeLeft);
    if TimeLeft = 0 then
    begin
    GotoXY(37,23);
    write('Time Up ! You are loss!');
    exitt(k);
    end;
    if keypressed then
    begin
    ch := Readkey ;
    case ch of
    {show answer when user press Tab}
    #9: write('Answer is CLOCK TOWER. (Press ESC to exit)');
    #13:UserEntered := true; {User must input the letter then press enter}
    #27: exit ; {press ESC then exit}

    end;
    while KeyPressed do ReadKey; { Remove extended }
    GotoXY(X,Y); {show the Letter that User entered in the boxes}
    write(ch);
    end;
    until UserEntered; {user press enter}
    if ch <> AnswerLetter then
    Get_hint(hint);
    if TimeLeft = 0 then {time up then loss}
    begin
    GotoXY(37,23);
    write('Time Up ! You are loss!');
    exitt(k);
    end;
    until ch = AnswerLetter ;
    Textcolor(14);
    GotoXY (X,Y);
    write(ch);
    GotoXY (A,B); {change color in Display}
    write(ch) ;
    end;

    [/code]
    But there are some problem.
    I don't Know why I have'nt pressed enter, the program changed the letter in Display.
    And it can't get hint.

    The Gethint procedure is show below:
    [code]
    procedure Get_hint (var count:integer);
    var k:char;
    begin
    count:=0;
    [red]if ch <> AnswerLetter then [/red]
    count:=count+1;
    if count=1 then
    GotoXY(9,29);
    if count=2 then
    GotoXY(9,30);
    if count=3 then
    GotoXY(9,31);
    if count=4 then
    GotoXY(37,23);
    case count of
    1:writeln('Hint 1');
    2:writeln('Hint 2');
    3:writeln('Hint 3');
    end;
    if count=4 then { no chance}
    begin
    writeln('You are loss!!') ;
    exitt(k);
    end;
    end;
    [/code]

    I don't know why??
    Is it the red statement is wrong??

    Thank!!



  • zibadianzibadian Member Posts: 6,349
    : : : : [b][red]This message was edited by juice88 at 2005-1-6 7:45:47[/red][/b][hr]
    : : : : [b][red]This message was edited by juice88 at 2005-1-6 7:45:7[/red][/b][hr]
    : : : : : : : : : : i have some questions about crossword ~
    : : : : : : : : : : Please help me!
    : : : : : : : : : :
    : : : : : : : : : : 1) How to set the background colour and text colour in pascal??
    : : : : : : : : : :
    : : : : : : : : : : 2) I want to know does pascal has this function??
    : : : : : : : : : : if i input the right answer in the game
    : : : : : : : : : : then the colour of text will change to another colour~~
    : : : : : : : : : : How can do this??
    : : : : : : : : : :
    : : : : : : : : : : Suggest the simplest way to me~
    : : : : : : : : : : THZ~
    : : : : : : : : : :
    : : : : : : : : : 1: TextColor() and TextBackground() in the CRT unit.
    : : : : : : : : :
    : : : : : : : : : 2: Set the new textcolor and write the answer again at the same location.
    : : : : : : : : :
    : : : : : : : : THX~
    : : : : : : : : BUT I Have a error200 when i set the text colour.
    : : : : : : : :
    : : : : : : : :
    : : : : : : : :
    : : : : : : : :
    : : : : : : : If you are using TP, have you patched your CRT unit? If not search for CRT patch on google, and install that. It is necessary for fast computers.
    : : : : : : :
    : : : : : : OK!The problem has been solved.
    : : : : : :
    : : : : : : 2)I think this method is not suitable in my idea.
    : : : : : : My idea is like that:
    : : : : : : I had set a display with many letters for the player to choose them.
    : : : : : : If they choose a right letter, it will change colour.
    : : : : : :
    : : : : : : Any other method??
    : : : : : :
    : : : : : : 3)How to set a timer that count down 30 minutes.
    : : : : : :
    : : : : : :
    : : : : : Inc is short for increase, which should be explained in the help files.
    : : : : : ReadText() is designed to get the whole answer in 1 loop, then you can check it and ask the user the next question.
    : : : :
    : : : :
    : : : : But how the program know when should it increase??
    : : : : What is the use of this inc() comment in the crossword??
    : : : :
    : : : : NO~ I want to get each of the letter in loop,then i can check it one by one and move to next letter if the user entered is right.
    : : : :
    : : : : layout
    : : : : [code]
    : : : : ###########################################
    : : : : # # # # # # #
    : : : : # # # # # # #
    : : : : ###########################################
    : : : : [/code]
    : : : : There are 6 boxes, the user need to enter the first letter in the first box and press enter and then check it .If the letter is right ,then (GotoXY) move to next box and enter the second letter......Therefore the coordinateXY of each boxes are different .
    : : : :
    : : : : So how can the function work in this way??
    : : : :
    : : : : :
    : : : :
    : : :
    : : : ??
    : : :
    : : I would use the normal KeyPressed/Readkey combination for that:
    : : [code]
    : : repeat
    : : ch := '';
    : : repeat
    : : { Show time to user }
    : : [red]if CurrentTime > EndTime then[/red]
    : : Break;
    : : if KeyPressed then
    : : ch := ReadKey;
    : : until ch <> '';
    : : [red]if CurrentTime > EndTime then[/red]
    : : Break;
    : : until ch = AnswerLetter;
    : : [/code]
    : : You might want to place this loop into a function with the AnswerLetter as parameter and the user input as result.
    : : The red if-thens's need some work. These are to ensure that the user runs out of time during the input.
    : :
    : I get your point !!
    : Am I right??
    :
    : [code]
    : function UserInput (var AnswerLetter:char;X,Y,A,B:integer): string ;
    : var
    : TimeLeft,GameStartTime,hint:integer ;
    : k:char ;
    : UserEntered : boolean;
    : begin
    : GameStartTime := TimeInMin;
    : repeat
    : UserInput:='';
    : repeat
    : TimeLeft:=(3-(TimeInMin-GameStartTime));
    : GotoXY(8,34);
    : write(TimeLeft);
    : if TimeLeft = 0 then
    : begin
    : GotoXY(37,23);
    : write('Time Up ! You are loss!');
    : exitt(k);
    : end;
    : if keypressed then
    : begin
    : ch := Readkey ;
    : case ch of
    : {show answer when user press Tab}
    : #9: write('Answer is CLOCK TOWER. (Press ESC to exit)');
    : #13:UserEntered := true; {User must input the letter then press enter}
    : #27: exit ; {press ESC then exit}
    :
    : end;
    : while KeyPressed do ReadKey; { Remove extended }
    : GotoXY(X,Y); {show the Letter that User entered in the boxes}
    : write(ch);
    : end;
    : until UserEntered; {user press enter}
    : if ch <> AnswerLetter then
    : Get_hint(hint);
    : if TimeLeft = 0 then {time up then loss}
    : begin
    : GotoXY(37,23);
    : write('Time Up ! You are loss!');
    : exitt(k);
    : end;
    : until ch = AnswerLetter ;
    : Textcolor(14);
    : GotoXY (X,Y);
    : write(ch);
    : GotoXY (A,B); {change color in Display}
    : write(ch) ;
    : end;
    :
    : [/code]
    : But there are some problem.
    : I don't Know why I have'nt pressed enter, the program changed the letter in Display.
    : And it can't get hint.
    :
    : The Gethint procedure is show below:
    : [code]
    : procedure Get_hint (var count:integer);
    : var k:char;
    : begin
    : count:=0;
    : [red]if ch <> AnswerLetter then [/red]
    : count:=count+1;
    : if count=1 then
    : GotoXY(9,29);
    : if count=2 then
    : GotoXY(9,30);
    : if count=3 then
    : GotoXY(9,31);
    : if count=4 then
    : GotoXY(37,23);
    : case count of
    : 1:writeln('Hint 1');
    : 2:writeln('Hint 2');
    : 3:writeln('Hint 3');
    : end;
    : if count=4 then { no chance}
    : begin
    : writeln('You are loss!!') ;
    : exitt(k);
    : end;
    : end;
    : [/code]
    :
    : I don't know why??
    : Is it the red statement is wrong??
    :
    : Thank!!
    :
    :
    :
    :
    THe Get_Hint will only show the first or no hint, depending on the condition in the red statement. If you run that code in your head and keep track of count as it changes in each line, you will see why.
  • juice88juice88 Member Posts: 23
    [b][red]This message was edited by juice88 at 2005-1-11 8:50:18[/red][/b][hr]
    [b][red]This message was edited by juice88 at 2005-1-11 6:14:26[/red][/b][hr]
    [b][red]This message was edited by juice88 at 2005-1-11 6:11:48[/red][/b][hr]
    : : : [b][red]This message was edited by juice88 at 2005-1-6 7:45:47[/red][/b][hr]
    : : : [b][red]This message was edited by juice88 at 2005-1-6 7:45:7[/red][/b][hr]
    : : : : : : : : : i have some questions about crossword ~
    : : : : : : : : : Please help me!
    : : : : : : : : :
    : : : : : : : : : 1) How to set the background colour and text colour in pascal??
    : : : : : : : : :
    : : : : : : : : : 2) I want to know does pascal has this function??
    : : : : : : : : : if i input the right answer in the game
    : : : : : : : : : then the colour of text will change to another colour~~
    : : : : : : : : : How can do this??
    : : : : : : : : :
    : : : : : : : : : Suggest the simplest way to me~
    : : : : : : : : : THZ~
    : : : : : : : : :
    : : : : : : : : 1: TextColor() and TextBackground() in the CRT unit.
    : : : : : : : :
    : : : : : : : : 2: Set the new textcolor and write the answer again at the same location.
    : : : : : : : :
    : : : : : : : THX~
    : : : : : : : BUT I Have a error200 when i set the text colour.
    : : : : : : :
    : : : : : : :
    : : : : : : :
    : : : : : : :
    : : : : : : If you are using TP, have you patched your CRT unit? If not search for CRT patch on google, and install that. It is necessary for fast computers.
    : : : : : :
    : : : : : OK!The problem has been solved.
    : : : : :
    : : : : : 2)I think this method is not suitable in my idea.
    : : : : : My idea is like that:
    : : : : : I had set a display with many letters for the player to choose them.
    : : : : : If they choose a right letter, it will change colour.
    : : : : :
    : : : : : Any other method??
    : : : : :
    : : : : : 3)How to set a timer that count down 30 minutes.
    : : : : :
    : : : : :
    : : : : Inc is short for increase, which should be explained in the help files.
    : : : : ReadText() is designed to get the whole answer in 1 loop, then you can check it and ask the user the next question.
    : : :
    : : :
    : : : But how the program know when should it increase??
    : : : What is the use of this inc() comment in the crossword??
    : : :
    : : : NO~ I want to get each of the letter in loop,then i can check it one by one and move to next letter if the user entered is right.
    : : :
    : : : layout
    : : : [code]
    : : : ###########################################
    : : : # # # # # # #
    : : : # # # # # # #
    : : : ###########################################
    : : : [/code]
    : : : There are 6 boxes, the user need to enter the first letter in the first box and press enter and then check it .If the letter is right ,then (GotoXY) move to next box and enter the second letter......Therefore the coordinateXY of each boxes are different .
    : : :
    : : : So how can the function work in this way??
    : : :
    : : : :
    : : :
    : :
    : : ??
    : :
    : I would use the normal KeyPressed/Readkey combination for that:
    : [code]
    : repeat
    : ch := '';
    : repeat
    : { Show time to user }
    : [red]if CurrentTime > EndTime then[/red]
    : Break;
    : if KeyPressed then
    : ch := ReadKey;
    : until ch <> '';
    : [red]if CurrentTime > EndTime then[/red]
    : Break;
    : until ch = AnswerLetter;
    : [/code]
    : You might want to place this loop into a function with the AnswerLetter as parameter and the user input as result.
    : The red if-thens's need some work. These are to ensure that the user runs out of time during the input.
    :



    : THe Get_Hint will only show the first or no hint, depending on the condition in the red statement. If you run that code in your head and keep track of count as it changes in each line, you will see why.
    :
    Is it because of the code count:=0??
    I have put the declaration count:integer in the heading to becomes the global variable.
    How can I solve it??

    How about my first question??
    why I have'nt pressed enter, the program changed color of the letter in Display.
    I want it to change the color after user input right letter~







  • superlemonsuperlemon Member Posts: 1
    HIHI~
    I also need to write this program.
    I have some problems need for help.
    Please help me!
    I want to ask that can I use CRT in TB WINDOWS 1.5??
124»
Sign In or Register to comment.