From 820d4b3a9d33815e0e9437b8464d502cbf0036f7 Mon Sep 17 00:00:00 2001 From: Celine Khazarian Date: Fri, 9 Feb 2024 00:42:43 +0100 Subject: [PATCH] refactoring: von computer zu Player2 --- src/main/c/SchereSteinPapier.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/c/SchereSteinPapier.c b/src/main/c/SchereSteinPapier.c index 540838d..4603ab1 100644 --- a/src/main/c/SchereSteinPapier.c +++ b/src/main/c/SchereSteinPapier.c @@ -3,24 +3,24 @@ #include #include -int game(char Player1, char computer) +int game(char Player1, char Player2) { - if (Player1 == '1' && computer == '1') + if (Player1 == '1' && Player2 == '1') return -1; - if (Player1 == '2' && computer == '2') + if (Player1 == '2' && Player2 == '2') return -1; - if (Player1 == '3' && computer == '3') + if (Player1 == '3' && Player2 == '3') return -1; - if (Player1 == '2' && computer == '3') + if (Player1 == '2' && Player2 == '3') return 0; - else if (Player1 == '3' && computer == '2') return 1; - if (Player1 == '2' && computer == '1') + else if (Player1 == '3' && Player2 == '2') return 1; + if (Player1 == '2' && Player2 == '1') return 1; - else if (Player1 == '1' && computer == '2') + else if (Player1 == '1' && Player2 == '2') return 0; - if (Player1 == '3' && computer == '1') + if (Player1 == '3' && Player2 == '1') return 0; - else if (Player1 == '1' && computer == '3') + else if (Player1 == '1' && Player2 == '3') return 1; }