crossword!!

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~
«13

Comments

  • : 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.
  • : : 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.



  • : : : 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.
  • : : : : 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.

  • [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    :
    :
    2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.

    3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    [code]
    function TimeInMin: Word;
    var
    Hour, Minutes, Seconds, HSeconds: word;
    begin
    GetTime(Hour, Minutes, Seconds, HSeconds);
    TimeInMin := Hour*60+Minutes;
    end;

    var
    GameFinished: boolean;
    { program part }
    GameStartTime := TimeInMin;
    GameFinished := false;

    repeat

    { Do Game }
    { Do not use read() or readln(), because those have their own waiting routine }
    { but readkey() and keypressed() instead }
    { If the player successfully finishes the game set the GameFinished to true }
    { If you want to let the player know how much time is left: }
    { write the following result somewhere: 30-(TimeInMin-GameStart) }

    until (TimeInMin = GameStartTime+30) or GameFinished;

    if GameFinished then
    PlayerHasWon
    else
    PlayerHasLost;
    [/code]


  • : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : :
    : :
    : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    :
    : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : [code]
    : function TimeInMin: Word;
    : var
    : Hour, Minutes, Seconds, HSeconds: word;
    : begin
    : GetTime(Hour, Minutes, Seconds, HSeconds);
    : TimeInMin := Hour*60+Minutes;
    : end;
    :
    : var
    : GameFinished: boolean;
    : { program part }
    : GameStartTime := TimeInMin;
    : GameFinished := false;
    :
    : repeat
    :
    : { Do Game }
    : { Do not use read() or readln(), because those have their own waiting routine }
    : { but readkey() and keypressed() instead }
    : { If the player successfully finishes the game set the GameFinished to true }
    : { If you want to let the player know how much time is left: }
    : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    :
    : until (TimeInMin = GameStartTime+30) or GameFinished;
    :
    : if GameFinished then
    : PlayerHasWon
    : else
    : PlayerHasLost;
    : [/code]
    :
    :
    :
    Thank you.
    But it said GetTime is a unknown identifier.
    what should it set?
    uses crt ??uses Doc or something else??
  • : : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : : :
    : : :
    : : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    : :
    : : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : : [code]
    : : function TimeInMin: Word;
    : : var
    : : Hour, Minutes, Seconds, HSeconds: word;
    : : begin
    : : GetTime(Hour, Minutes, Seconds, HSeconds);
    : : TimeInMin := Hour*60+Minutes;
    : : end;
    : :
    : : var
    : : GameFinished: boolean;
    : : { program part }
    : : GameStartTime := TimeInMin;
    : : GameFinished := false;
    : :
    : : repeat
    : :
    : : { Do Game }
    : : { Do not use read() or readln(), because those have their own waiting routine }
    : : { but readkey() and keypressed() instead }
    : : { If the player successfully finishes the game set the GameFinished to true }
    : : { If you want to let the player know how much time is left: }
    : : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    : :
    : : until (TimeInMin = GameStartTime+30) or GameFinished;
    : :
    : : if GameFinished then
    : : PlayerHasWon
    : : else
    : : PlayerHasLost;
    : : [/code]
    : :
    : :
    : :
    : Thank you.
    : But it said GetTime is a unknown identifier.
    : what should it set?
    : uses crt ??uses Doc or something else??
    :
    GetTime() is part of the Crt unit. This kind of questions can also be answered by looking the function up in the help files. It lists the unit and also the precise description and declaration.
  • : : : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : : : :
    : : : :
    : : : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    : : :
    : : : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : : : [code]
    : : : function TimeInMin: Word;
    : : : var
    : : : Hour, Minutes, Seconds, HSeconds: word;
    : : : begin
    : : : GetTime(Hour, Minutes, Seconds, HSeconds);
    : : : TimeInMin := Hour*60+Minutes;
    : : : end;
    : : :
    : : : var
    : : : GameFinished: boolean;
    : : : { program part }
    : : : GameStartTime := TimeInMin;
    : : : GameFinished := false;
    : : :
    : : : repeat
    : : :
    : : : { Do Game }
    : : : { Do not use read() or readln(), because those have their own waiting routine }
    : : : { but readkey() and keypressed() instead }
    : : : { If the player successfully finishes the game set the GameFinished to true }
    : : : { If you want to let the player know how much time is left: }
    : : : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    : : :
    : : : until (TimeInMin = GameStartTime+30) or GameFinished;
    : : :
    : : : if GameFinished then
    : : : PlayerHasWon
    : : : else
    : : : PlayerHasLost;
    : : : [/code]
    : : :
    : : :
    : : :
    : : Thank you.
    : : But it said GetTime is a unknown identifier.
    : : what should it set?
    : : uses crt ??uses Doc or something else??
    : :
    : GetTime() is part of the Crt unit. This kind of questions can also be answered by looking the function up in the help files. It lists the unit and also the precise description and declaration.
    :
    I can't do it .Can you make a sample to me??
  • : : : : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : : : : :
    : : : : :
    : : : : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    : : : :
    : : : : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : : : : [code]
    : : : : function TimeInMin: Word;
    : : : : var
    : : : : Hour, Minutes, Seconds, HSeconds: word;
    : : : : begin
    : : : : GetTime(Hour, Minutes, Seconds, HSeconds);
    : : : : TimeInMin := Hour*60+Minutes;
    : : : : end;
    : : : :
    : : : : var
    : : : : GameFinished: boolean;
    : : : : { program part }
    : : : : GameStartTime := TimeInMin;
    : : : : GameFinished := false;
    : : : :
    : : : : repeat
    : : : :
    : : : : { Do Game }
    : : : : { Do not use read() or readln(), because those have their own waiting routine }
    : : : : { but readkey() and keypressed() instead }
    : : : : { If the player successfully finishes the game set the GameFinished to true }
    : : : : { If you want to let the player know how much time is left: }
    : : : : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    : : : :
    : : : : until (TimeInMin = GameStartTime+30) or GameFinished;
    : : : :
    : : : : if GameFinished then
    : : : : PlayerHasWon
    : : : : else
    : : : : PlayerHasLost;
    : : : : [/code]
    : : : :
    : : : :
    : : : :
    : : : Thank you.
    : : : But it said GetTime is a unknown identifier.
    : : : what should it set?
    : : : uses crt ??uses Doc or something else??
    : : :
    : : GetTime() is part of the Crt unit. This kind of questions can also be answered by looking the function up in the help files. It lists the unit and also the precise description and declaration.
    : :
    : I can't do it .Can you make a sample to me??
    :
    Here is a sample, which asks you to type a word in 3 minutes:
    [code]
    uses Crt;

    function TimeInMin: Word;
    var
    Hour, Minutes, Seconds, HSeconds: word;
    begin
    GetTime(Hour, Minutes, Seconds, HSeconds);
    TimeInMin := Hour*60+Minutes;
    end;

    var
    GameFinished: boolean;
    TypedWord: string;
    ch: char;
    begin
    GameStartTime := TimeInMin;
    GameFinished := false;
    TypedWord := '';
    GotoXY(1,1); write('Enter word: ');
    repeat
    if Keypressed then
    begin
    ch := readkey;
    case ch of
    #8 {Backspace}: Delete(TypedWord, Length(TypedWord), 1);
    #13 {Enter}: GameFinished := true; {end game}
    #0 {Extended char}: ch := readkey; {clear buffer}
    #1..#7,#9..#12,#14..#19 {system commands}: begin end; {ignore}
    else TypedWord := TypedWord + ch;
    end;
    GotoXY(1,1); write('Enter word: ', TypedWord);
    end;
    until (TimeInMin = GameStartTime+3) or GameFinished;

    if GameFinished then
    begin
    if TypedWord = 'This is an example game' then
    writeln('You typed the correct word.')
    else
    writeln('You typed an incorrect word.')
    end else
    writeln('You did not type fast enough');
    readln;
    end.
    [/code]
  • : : : : : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : : : : : :
    : : : : : :
    : : : : : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    : : : : :
    : : : : : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : : : : : [code]
    : : : : : function TimeInMin: Word;
    : : : : : var
    : : : : : Hour, Minutes, Seconds, HSeconds: word;
    : : : : : begin
    : : : : : GetTime(Hour, Minutes, Seconds, HSeconds);
    : : : : : TimeInMin := Hour*60+Minutes;
    : : : : : end;
    : : : : :
    : : : : : var
    : : : : : GameFinished: boolean;
    : : : : : { program part }
    : : : : : GameStartTime := TimeInMin;
    : : : : : GameFinished := false;
    : : : : :
    : : : : : repeat
    : : : : :
    : : : : : { Do Game }
    : : : : : { Do not use read() or readln(), because those have their own waiting routine }
    : : : : : { but readkey() and keypressed() instead }
    : : : : : { If the player successfully finishes the game set the GameFinished to true }
    : : : : : { If you want to let the player know how much time is left: }
    : : : : : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    : : : : :
    : : : : : until (TimeInMin = GameStartTime+30) or GameFinished;
    : : : : :
    : : : : : if GameFinished then
    : : : : : PlayerHasWon
    : : : : : else
    : : : : : PlayerHasLost;
    : : : : : [/code]
    : : : : :
    : : : : :
    : : : : :
    : : : : Thank you.
    : : : : But it said GetTime is a unknown identifier.
    : : : : what should it set?
    : : : : uses crt ??uses Doc or something else??
    : : : :
    : : : GetTime() is part of the Crt unit. This kind of questions can also be answered by looking the function up in the help files. It lists the unit and also the precise description and declaration.
    : : :
    : : I can't do it .Can you make a sample to me??
    : :
    : Here is a sample, which asks you to type a word in 3 minutes:
    : [code]
    : uses Crt;
    :
    : function TimeInMin: Word;
    : var
    : Hour, Minutes, Seconds, HSeconds: word;
    : begin
    : GetTime(Hour, Minutes, Seconds, HSeconds);
    : TimeInMin := Hour*60+Minutes;
    : end;
    :
    : var
    : GameFinished: boolean;
    : TypedWord: string;
    : ch: char;
    : begin
    : GameStartTime := TimeInMin;
    : GameFinished := false;
    : TypedWord := '';
    : GotoXY(1,1); write('Enter word: ');
    : repeat
    : if Keypressed then
    : begin
    : ch := readkey;
    : case ch of
    : #8 {Backspace}: Delete(TypedWord, Length(TypedWord), 1);
    : #13 {Enter}: GameFinished := true; {end game}
    : #0 {Extended char}: ch := readkey; {clear buffer}
    : #1..#7,#9..#12,#14..#19 {system commands}: begin end; {ignore}
    : else TypedWord := TypedWord + ch;
    : end;
    : GotoXY(1,1); write('Enter word: ', TypedWord);
    : end;
    : until (TimeInMin = GameStartTime+3) or GameFinished;
    :
    : if GameFinished then
    : begin
    : if TypedWord = 'This is an example game' then
    : writeln('You typed the correct word.')
    : else
    : writeln('You typed an incorrect word.')
    : end else
    : writeln('You did not type fast enough');
    : readln;
    : end.
    : [/code]
    :
    THX!!!!
    { If you want to let the player know how much time is left: }
    { write the following result somewhere: 30-(TimeInMin-GameStart) }
    How about this??

  • : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : :
    : :
    : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    :
    : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : [code]
    : function TimeInMin: Word;
    : var
    : Hour, Minutes, Seconds, HSeconds: word;
    : begin
    : GetTime(Hour, Minutes, Seconds, HSeconds);
    : TimeInMin := Hour*60+Minutes;
    : end;
    :
    : var
    : GameFinished: boolean;
    : { program part }
    : GameStartTime := TimeInMin;
    : GameFinished := false;
    :
    : repeat
    :
    : { Do Game }
    : { Do not use read() or readln(), because those have their own waiting routine }
    : { but readkey() and keypressed() instead }
    : { If the player successfully finishes the game set the GameFinished to true }
    : { If you want to let the player know how much time is left: }
    : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    :
    : until (TimeInMin = GameStartTime+30) or GameFinished;
    :
    : if GameFinished then
    : PlayerHasWon
    : else
    : PlayerHasLost;
    : [/code]
    :
    :
    :
    That can be inserted any where in the loop:
    [code]
    GotoXY(1,2);
    write('Time left: ', 3-(TimeInMin-GameStart));
    [/code]
    This code will cause flickering of the time left. A better way is to check if the time left is changed since the last writing of it, which involves a simple if-then and storing the value of time left after writing it.
  • I don't know how to do it, but can you me the program . I'd like to
    play it
  • : : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : : :
    : : :
    : : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    : :
    : : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : : [code]
    : : function TimeInMin: Word;
    : : var
    : : Hour, Minutes, Seconds, HSeconds: word;
    : : begin
    : : GetTime(Hour, Minutes, Seconds, HSeconds);
    : : TimeInMin := Hour*60+Minutes;
    : : end;
    : :
    : : var
    : : GameFinished: boolean;
    : : { program part }
    : : GameStartTime := TimeInMin;
    : : GameFinished := false;
    : :
    : : repeat
    : :
    : : { Do Game }
    : : { Do not use read() or readln(), because those have their own waiting routine }
    : : { but readkey() and keypressed() instead }
    : : { If the player successfully finishes the game set the GameFinished to true }
    : : { If you want to let the player know how much time is left: }
    : : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    : :
    : : until (TimeInMin = GameStartTime+30) or GameFinished;
    : :
    : : if GameFinished then
    : : PlayerHasWon
    : : else
    : : PlayerHasLost;
    : : [/code]
    : :
    : :
    : :
    : That can be inserted any where in the loop:
    : [code]
    : GotoXY(1,2);
    : write('Time left: ', 3-(TimeInMin-GameStart));
    : [/code]
    : This code will cause flickering of the time left. A better way is to check if the time left is changed since the last writing of it, which involves a simple if-then and storing the value of time left after writing it.
    :
    I can't play the timer and main program at the same time ~
    Maybe some program formed
    Can you help me to see~?
    My program:
    repeat
    GotoXY(1,2);
    write('Time left: ', 3-(TimeInMin-GameStart));

    repeat
    ans 1
    until XXXXX

    repeat
    ans 2
    until XXXXX

    repeat
    ans 3
    until XXX

    until
    (TimeInMin = GameStartTime+3) or GameFinished;
    write('You are loss);

    it can't work~


  • : : : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : : : :
    : : : :
    : : : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    : : :
    : : : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : : : [code]
    : : : function TimeInMin: Word;
    : : : var
    : : : Hour, Minutes, Seconds, HSeconds: word;
    : : : begin
    : : : GetTime(Hour, Minutes, Seconds, HSeconds);
    : : : TimeInMin := Hour*60+Minutes;
    : : : end;
    : : :
    : : : var
    : : : GameFinished: boolean;
    : : : { program part }
    : : : GameStartTime := TimeInMin;
    : : : GameFinished := false;
    : : :
    : : : repeat
    : : :
    : : : { Do Game }
    : : : { Do not use read() or readln(), because those have their own waiting routine }
    : : : { but readkey() and keypressed() instead }
    : : : { If the player successfully finishes the game set the GameFinished to true }
    : : : { If you want to let the player know how much time is left: }
    : : : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    : : :
    : : : until (TimeInMin = GameStartTime+30) or GameFinished;
    : : :
    : : : if GameFinished then
    : : : PlayerHasWon
    : : : else
    : : : PlayerHasLost;
    : : : [/code]
    : : :
    : : :
    : : :
    : : That can be inserted any where in the loop:
    : : [code]
    : : GotoXY(1,2);
    : : write('Time left: ', 3-(TimeInMin-GameStart));
    : : [/code]
    : : This code will cause flickering of the time left. A better way is to check if the time left is changed since the last writing of it, which involves a simple if-then and storing the value of time left after writing it.
    : :
    : I can't play the timer and main program at the same time ~
    : Maybe some program formed
    : Can you help me to see~?
    : My program:
    : repeat
    : GotoXY(1,2);
    : write('Time left: ', 3-(TimeInMin-GameStart));
    :
    : repeat
    : ans 1
    : until XXXXX
    :
    : repeat
    : ans 2
    : until XXXXX
    :
    : repeat
    : ans 3
    : until XXX
    :
    : until
    : (TimeInMin = GameStartTime+3) or GameFinished;
    : write('You are loss);
    :
    : it can't work~
    :
    :
    :
    There is only 1 repeat-until loop:
    [code]
    repeat
    GotoXY(1,2);
    write('Time left: ', 3-(TimeInMin-GameStart));
    ans 1
    ans 2
    ans 3
    until
    (TimeInMin = GameStartTime+3) or GameFinished;
    write('You are loss);
    [/code]
    If you want to indicate a wrong answer, you need to add a boolean variable to the game. This variable can also be used to finish the loop.
  • [b][red]This message was edited by juice88 at 2004-12-22 8:37:46[/red][/b][hr]
    : : : : [b][red]This message was edited by zibadian at 2004-11-19 12:49:51[/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.
    : : : : :
    : : : : :
    : : : : 2: You could change the color directly in the video memory, but that would require some assembly and an intricate knowledge of the video memory. The only true-Pascal way is to use TextColor(), TextBackround(), GotoXY() and write() to set it.
    : : : :
    : : : : 3: The only two ways to do this is to either use interrupts, or use a loop and GetTime(). Here is a sample code to illustrate the latter:
    : : : : [code]
    : : : : function TimeInMin: Word;
    : : : : var
    : : : : Hour, Minutes, Seconds, HSeconds: word;
    : : : : begin
    : : : : GetTime(Hour, Minutes, Seconds, HSeconds);
    : : : : TimeInMin := Hour*60+Minutes;
    : : : : end;
    : : : :
    : : : : var
    : : : : GameFinished: boolean;
    : : : : { program part }
    : : : : GameStartTime := TimeInMin;
    : : : : GameFinished := false;
    : : : :
    : : : : repeat
    : : : :
    : : : : { Do Game }
    : : : : { Do not use read() or readln(), because those have their own waiting routine }
    : : : : { but readkey() and keypressed() instead }
    : : : : { If the player successfully finishes the game set the GameFinished to true }
    : : : : { If you want to let the player know how much time is left: }
    : : : : { write the following result somewhere: 30-(TimeInMin-GameStart) }
    : : : :
    : : : : until (TimeInMin = GameStartTime+30) or GameFinished;
    : : : :
    : : : : if GameFinished then
    : : : : PlayerHasWon
    : : : : else
    : : : : PlayerHasLost;
    : : : : [/code]
    : : : :
    : : : :
    : : : :
    : : : That can be inserted any where in the loop:
    : : : [code]
    : : : GotoXY(1,2);
    : : : write('Time left: ', 3-(TimeInMin-GameStart));
    : : : [/code]
    : : : This code will cause flickering of the time left. A better way is to check if the time left is changed since the last writing of it, which involves a simple if-then and storing the value of time left after writing it.
    : : :
    : : I can't play the timer and main program at the same time ~
    : : Maybe some program formed
    : : Can you help me to see~?
    : : My program:
    : : repeat
    : : GotoXY(1,2);
    : : write('Time left: ', 3-(TimeInMin-GameStart));
    : :
    : : repeat
    : : ans 1
    : : until XXXXX
    : :
    : : repeat
    : : ans 2
    : : until XXXXX
    : :
    : : repeat
    : : ans 3
    : : until XXX
    : :
    : : until
    : : (TimeInMin = GameStartTime+3) or GameFinished;
    : : write('You are loss);
    : :
    : : it can't work~
    : :
    : :
    : :
    : There is only 1 repeat-until loop:
    : [code]
    : repeat
    : GotoXY(1,2);
    : write('Time left: ', 3-(TimeInMin-GameStart));
    : ans 1
    : ans 2
    : ans 3
    : until
    : (TimeInMin = GameStartTime+3) or GameFinished;
    : write('You are loss);
    : [/code]
    : If you want to indicate a wrong answer, you need to add a boolean variable to the game. This variable can also be used to finish the loop.
    :
    I stil cant do this!!
    ><"
    I think you misunderstand my program~
    My program is check the letter of the answer one by one ,
    not check the complete answer one by one.
    By similiar
    if the answer is 'Food'
    The player first input the first letter of his answer
    then I check it .
    if his lettter is incorrect , he will input it again until the letter is 'F' ,then he can input the second letter.
    Therefore ,many repeat loop must be used , then how can I add the timer in it??

    Sorry, my expreesion is not clear,
    hope that you can solve my program.


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