0

Dear Sir,

Can I add the background colour or music to my following program?

Program millionaire;//Student_millionaire;

{$APPTYPE CONSOLE}
uses
  SysUtils,
  OurCrt;

Type
   gameShow_record=record
   firstname:string[12];
   lastname:string[12];
   phone: string[12];
End;

Var User_Choice:Integer;

//this is your first program integrated in the main
Procedure Student_Millionaire;
//I not tested,you said it work
Var
  gameShow_file:file of gameShow_record;
  gameShow:array[1..45]of gameShow_record;
   count,max:integer;

Begin
     assign(gameShow_file,'gameShow.dat');
  reset(gameShow_file);

  max:= filesize(gameShow_file);
WriteLn('...LAST NAME..FIRST NAME..............PHONE......');
WriteLn;

for count:=  1 to max do
Begin
    read(gameShow_file,gameShow[count]);

WriteLn(gameShow[count].firstname:12,gameShow[count].lastname:12,gameShow[count].phone:20);
Sleep(50);
End;

Procedure ContestantsList;
  Begin
    WriteLn('1 pressed,listing all the contestants...');
    ReadLn;
  End;

Procedure Generate10finalists;
  Begin
    WriteLn('2 pressed,generating the 10 finalist''s numbers...');
    ReadLn;
  End;

Procedure UpdateFinalists;
  Begin
    WriteLn('3 pressed,finding and listing the finalists...');
    ReadLn;
  End;

Procedure ChangeDetails;
  Begin
    WriteLn('4 pressed,changing the phone a friend details...');
    ReadLn;
  End;

Procedure EnrolContestant;
  Begin
    WriteLn('5 pressed,enroling a new contestant...');
    ReadLn;
  End;

Procedure GetOutOfHere;
  Begin
    WriteLn('6 pressed,exiting...');
    Sleep(1000);

  End;

Begin
   User_Choice:=0;
   While User_Choice <> 6 Do Begin
      ClrScr;
      WriteLn('Please enter an integer in the range 1...7');
      WriteLn;
      WriteLn('  1 List all the contestants');
      WriteLn('  2 Generate the 10 finalist''s numbers');
      WriteLn('  3 Find and list the finalists');
      WriteLn('  4 Change the phone a friend details');
      WriteLn('  5 Enrol a new contestant');
      WriteLn('  6 Exit');
      WriteLn('  7 student millionaire');

      ReadLn(User_Choice);

      Case (User_Choice) of
         1:ContestantsList;
         2:Generate10finalists;
         3:UpdateFinalists;
         4:ChangeDetails;
         5:EnrolContestant;
         6:GetOutOfHere;
         7:Student_Millionaire;//here is the number I talked about
      Else
        Begin
             WriteLn('Wrong Number..');
             WriteLn('Exiting...');
         End;
      End;
    End;
End;
End.

For example, if I press <1>, the background has the background colour and sound / sound, ......

Cheers,

Edited by Nick Evan: Fixed formatting

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by FlamingClaw
0

Can your 'OurCrt unit' handles the colors of the console window?Cause the pascal 'Crt unit' is can. :D. like TextColor(Red); or BackGround(Blue); or TextAttr(10*16)+4;
In pascal's Crt unit's Sound procedure can make some noise from the speaker

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.