Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Need help using random function in pascal

Name: Anonymous 2011-03-10 12:03

hai guise

have this programme:

Program Notwo;
uses wincrt;


var
   letter : char;



function dice(a:integer):integer;
begin
     dice:=random(a);
     writeln('You rolled a 'a);
end;






begin {of main}
      Repeat
            dice;
               write('Enter x to quit the loop : ');
               readln(letter);
            if (letter = 'x') or (letter = 'X') then
            writeln(letter,' entered end of program !');
               Until (letter = 'x') or (letter = 'X');
end. {of main}

But what i need it to do is randomise a dice which repeats till the uset hits x.

how comes this doesnt work?

thnx

Name: Anonymous 2011-03-10 12:20

pascal
U MENA HASKAL

Name: Anonymous 2011-03-10 12:41

>>2
I MENA PASCELL

Name: Anonymous 2011-03-10 14:30

you need less interaction with people and more time spent coding

Name: Anonymous 2011-03-10 16:00

>>1
               write('Enter x to quit the loop : ');
: ')

Don't change these.
Name: Email:
Entire Thread Thread List