-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscriptgit.js
73 lines (59 loc) · 2.79 KB
/
scriptgit.js
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
73
const cards = [
{ value: 2, name: "Diamonds of Two", id: 1 },
{ value: 2, name: "Clubs of Two", id: 2 },
{ value: 2, name: "Hearts of Two", id: 3 },
{ value: 2, name: "Spades of Two", id: 4 },
{ value: 3, name: "Diamonds of Three", id: 5 },
{ value: 3, name: "Clubs of Three", id: 6 },
{ value: 3, name: "Hearts of Three", id: 7 },
{ value: 3, name: "Spades of Three", id: 8 },
{ value: 4, name: "Diamonds of Four", id: 9 },
{ value: 4, name: "Clubs of Four", id: 10 },
{ value: 4, name: "Hearts of Four", id: 11 },
{ value: 4, name: "Spades of Four", id: 12 },
{ value: 5, name: "Diamonds of Five", id: 13 },
{ value: 5, name: "Clubs of Five", id: 14 },
{ value: 5, name: "Hearts of Five", id: 15 },
{ value: 5, name: "Spades of Five", id: 16 },
{ value: 6, name: "Diamonds of Six", id: 17 },
{ value: 6, name: "Clubs of Six", id: 18 },
{ value: 6, name: "Hearts of Six", id: 19 },
{ value: 6, name: "Spades of Six", id: 20 },
{ value: 7, name: "Diamonds of Seven", id: 21 },
{ value: 7, name: "Clubs of Seven", id: 22 },
{ value: 7, name: "Hearts of Seven", id: 23 },
{ value: 7, name: "Spades of Seven", id: 24 },
{ value: 8, name: "Diamonds of Eight", id: 25 },
{ value: 8, name: "Clubs of Eight", id: 26 },
{ value: 8, name: "Hearts of Eight", id: 27 },
{ value: 8, name: "Spades of Eight", id: 28 },
{ value: 9, name: "Diamonds of Nine", id: 29 },
{ value: 9, name: "Clubs of Nine", id: 30 },
{ value: 9, name: "Hearts of Nine", id: 31 },
{ value: 9, name: "Spades of Nine", id: 32 },
{ value: 10, name: "Diamonds of Ten", id: 33 },
{ value: 10, name: "Clubs of Ten", id: 34 },
{ value: 10, name: "Hearts of Ten", id: 35 },
{ value: 10, name: "Spades of Ten", id: 36 },
{ value: 10, name: "Diamonds of Jack", id: 37 },
{ value: 10, name: "Clubs of Jack", id: 38 },
{ value: 10, name: "Hearts of Jack", id: 39 },
{ value: 10, name: "Spades of Jack", id: 40 },
{ value: 10, name: "Diamonds of Queen", id: 41 },
{ value: 10, name: "Clubs of Queen", id: 42 },
{ value: 10, name: "Hearts of Queen", id: 43 },
{ value: 10, name: "Spades of Queen", id: 44 },
{ value: 10, name: "Diamonds of King", id: 45 },
{ value: 10, name: "Clubs of King", id: 46 },
{ value: 10, name: "Hearts of King", id: 47 },
{ value: 10, name: "Spades of King", id: 48 },
{ value: 11, name: "Diamonds of Ace", id: 49 },
{ value: 11, name: "Clubs of Ace", id: 50 },
{ value: 11, name: "Hearts of Ace", id: 51 },
{ value: 11, name: "Spades of Ace", id: 52 }
];
const play = () => {
const generatedNumber = Math.floor(Math.random() * 52) + 1;
give(cards[generatedNumber]);
}
play();