Quote Originally Posted by cairnswm
Should this not be a console app?
{$CONSOLE}
I think needs to be added before the Vars statement - I'm not sure this is correct though so please check in the help first.
The (documented) default in Free Pascal is a console app, so there is no need to force this.

Quote Originally Posted by cairnswm
Change to
[pascal]
RandomNumber := Trunc(Random * 2)+1;
[/pascal]
Huh, why? There is no need to teach this man floating point yet.


Quote Originally Posted by eJay
one problem i have though is that when the user presses 1 (head) they win, if they press 2 (tail) they lose. How can i make so that the user doesn't always win with head and lose with tail
This is because you haven't randomized the random generator yet. Computers are highly predictable devices, each time you run your program, the random number it starts with is the same.

To counter this, call "randomize" at the begin of your program, i.e.:

[pascal]
begin
randomize;
[/pascal]

A call to randomize will put the random generator in a ruly random state, so each time you run your program the result will be different.