0% found this document useful (0 votes)
12 views1 page

QWVFD

Uploaded by

wpcreaterpluce
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

QWVFD

Uploaded by

wpcreaterpluce
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

D:\Mars 11\Mine\noname01.

pas

program RockPaperScissors;

uses crt;

var
userChoice, computerChoice: Integer;
result: String;

begin
Randomize; // Initialize random number generator
WriteLn('Welcome to Rock, Paper, Scissors!');
WriteLn('Choose:');
WriteLn('1 - Rock');
WriteLn('2 - Paper');
WriteLn('3 - Scissors');

// Get the user's choice


Write('Enter your choice (1, 2, or 3): ');
ReadLn(userChoice);

// Get the computer's choice (random number between 1 and 3)


computerChoice := Random(3) + 1;

// Determine the result


if userChoice = computerChoice then
result := 'It''s a tie!'
else if (userChoice = 1) and (computerChoice = 3) or
(userChoice = 2) and (computerChoice = 1) or
(userChoice = 3) and (computerChoice = 2) then
result := 'You win!'
else
result := 'Computer wins!';

// Display the result


WriteLn('You chose: ', userChoice);
WriteLn('Computer chose: ', computerChoice);
WriteLn(result);

// Wait for the user to press a key before exiting


WriteLn('Press any

1/10/2025 - 3:48:42 PM - Page 1/1

You might also like