-
Notifications
You must be signed in to change notification settings - Fork 0
/
rock-paper- scissors.go
61 lines (55 loc) · 1.81 KB
/
rock-paper- scissors.go
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
package main
import (
"fmt"
"math/rand"
)
func main() {
var game bool = true;
var chose string;
var botchose int = rand.Intn(3);
for game {
fmt.Println("Taş : 1");
fmt.Println("Kağıt : 2");
fmt.Println("Makas : 3");
fmt.Scan(&chose);
botchose = rand.Intn(3);
//Berabere durumları
if chose == "1" && botchose == 1{
fmt.Println("Sen : Taş");
fmt.Println("Rakip : Taş");
fmt.Println("Berabere !!");
} else if chose == "2" && botchose == 2 {
fmt.Println("Sen : Kağıt");
fmt.Println("Rakip : Kağıt");
fmt.Println("Berabere !!");
} else if chose == "3" && botchose == 3 {
fmt.Println("Sen : Makas");
fmt.Println("Rakip : Makas");
fmt.Println("Berabere !!");
} else if chose == "1" && botchose == 3 { //Kazanma durumları
fmt.Println("Sen : Taş");
fmt.Println("Rakip : Makas");
fmt.Println("Kazandın !!");
} else if chose == "2" && botchose == 1 {
fmt.Println("Sen : Kağıt");
fmt.Println("Rakip : Taş");
fmt.Println("Kazandın !!");
} else if chose == "3" && botchose == 2 {
fmt.Println("Sen : Makas");
fmt.Println("Rakip : Kağıt");
fmt.Println("Kazandın !!");
} else if chose == "1" && botchose == 2 { //Kaybetme durumları
fmt.Println("Sen : Taş");
fmt.Println("Rakip : Kağıt");
fmt.Println("Kaybettin !!");
} else if chose == "2" && botchose == 3 {
fmt.Println("Sen : Kağıt");
fmt.Println("Rakip : Makas");
fmt.Println("Kaybettin !!");
} else if chose == "3" && botchose == 1 {
fmt.Println("Sen : Makas");
fmt.Println("Rakip : Taş");
fmt.Println("Kaybettin !!");
}
}
}