-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestprogram.mip
More file actions
72 lines (59 loc) · 1.91 KB
/
testprogram.mip
File metadata and controls
72 lines (59 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
program DEMOAPP
begin
var REPLAY = true;
while is REPLAY true begin
var PLAYER_ONE = "";
var PLAYER_ONE_GESTURE = "";
var PLAYER_TWO = "";
var PLAYER_TWO_GESTURE = "";
var INPUT = "";
write "Insert name of player 1:";
read PLAYER_ONE;
write "Insert name of player 2:";
read PLAYER_TWO;
write "Starting game with players:";
write PLAYER_ONE;
write PLAYER_TWO;
write "Choose a gesture (rock/paper/scissors) for the following player: ";
write PLAYER_ONE;
read PLAYER_ONE_GESTURE;
write "Choose a gesture (rock/paper/scissors) for the following player: ";
write PLAYER_TWO;
read PLAYER_TWO_GESTURE;
if is PLAYER_TWO_GESTURE PLAYER_ONE_GESTURE then begin
write "Draw";
end.
if is PLAYER_TWO_GESTURE "rock" and is PLAYER_ONE_GESTURE "scissors" then begin
write PLAYER_TWO;
write "wins";
end.
if is PLAYER_TWO_GESTURE "rock" and is PLAYER_ONE_GESTURE "paper" then begin
write PLAYER_ONE;
write "wins";
end.
if is PLAYER_TWO_GESTURE "scissors" and is PLAYER_ONE_GESTURE "paper" then begin
write PLAYER_TWO;
write "wins";
end.
if is PLAYER_TWO_GESTURE "scissors" and is PLAYER_ONE_GESTURE "rock" then begin
write PLAYER_ONE;
write "wins";
end.
if is PLAYER_TWO_GESTURE "paper" and is PLAYER_ONE_GESTURE "scissors" then begin
write PLAYER_ONE;
write "wins";
end.
if is PLAYER_TWO_GESTURE "paper" and is PLAYER_ONE_GESTURE "rock" then begin
write PLAYER_TWO;
write "wins";
end.
write "Do you want to play again?";
read INPUT;
if is INPUT "yes" then begin
set REPLAY = true;
end.
else begin
set REPLAY = false;
end.
end.
end.