Skip to content

Commit 11674f5

Browse files
vault backup: 2024-12-25 21:28:49
1 parent f5fd585 commit 11674f5

File tree

2 files changed

+274
-0
lines changed

2 files changed

+274
-0
lines changed

MatchState.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
A state is a set of variables that describe the current state of a match. They are governed by match format.
2+
3+
Match state for cricket might look like this:
4+
5+
```javascript
6+
const matchState = {
7+
State: {
8+
innings: {
9+
first: {
10+
battingTeam: "EEE",
11+
totalRuns: 56,
12+
over: 5.5,
13+
wicketsFallen: 4,
14+
Batting: {
15+
striker: {
16+
name: "PlayerA",
17+
runs: 34,
18+
outReason: null
19+
},
20+
nonStriker: {
21+
name: "PlayerD",
22+
runs: 20,
23+
outReason: null
24+
},
25+
order: [
26+
{
27+
name: "PlayerX",
28+
runs: 0,
29+
status: "out",
30+
profileLink: "https://example.com/profile/playerx",
31+
outReason: ["b", "Bowler1", null]
32+
},
33+
{
34+
name: "PlayerY",
35+
runs: 10,
36+
status: "out",
37+
profileLink: "https://example.com/profile/playery",
38+
outReason: ["c", "Bowler2", "PlayerZ"]
39+
},
40+
{
41+
name: "PlayerZ",
42+
runs: 15,
43+
status: "out",
44+
profileLink: "https://example.com/profile/playerz",
45+
outReason: ["run_out", null, "PlayerX"]
46+
},
47+
{
48+
name: "PlayerB",
49+
runs: 5,
50+
status: "out",
51+
profileLink: "https://example.com/profile/playerb",
52+
outReason: ["st", "Bowler3", "WicketKeeperA"]
53+
},
54+
{
55+
name: "PlayerA",
56+
runs: 34,
57+
status: "not out",
58+
profileLink: "https://example.com/profile/playera",
59+
outReason: null
60+
},
61+
{
62+
name: "PlayerD",
63+
runs: 20,
64+
status: "not out",
65+
profileLink: "https://example.com/profile/playerd",
66+
outReason: null
67+
}
68+
]
69+
},
70+
Bowling: {
71+
bowler: {
72+
name: "Bowler1",
73+
overs: 1.5,
74+
runsConceded: 24,
75+
wickets: 2
76+
},
77+
currentOver: [
78+
{ ball: 1, runs: 4, illegal: null },
79+
{ ball: 2, runs: 0, illegal: "no_ball" },
80+
{ ball: 3, runs: 1, illegal: "free_hit_legal" },
81+
{ ball: 4, runs: 0, illegal: null },
82+
{ ball: 5, runs: 6, illegal: null },
83+
{ ball: 6, runs: 0, illegal: null },
84+
{ ball: 7, runs: 0, illegal: "wide" }
85+
],
86+
order: [
87+
{
88+
name: "Bowler1",
89+
overs: 1.5,
90+
runsConceded: 15,
91+
wickets: 2,
92+
profileLink: "https://example.com/profile/bowler1"
93+
},
94+
{
95+
name: "Bowler2",
96+
overs: 2.0,
97+
runsConceded: 10,
98+
wickets: 1,
99+
profileLink: "https://example.com/profile/bowler2"
100+
},
101+
{
102+
name: "Bowler3",
103+
overs: 2.0,
104+
runsConceded: 20,
105+
wickets: 1,
106+
profileLink: "https://example.com/profile/bowler3"
107+
}
108+
],
109+
extras: {
110+
noBalls: 1,
111+
wides: 2,
112+
byes: 0,
113+
legByes: 0
114+
}
115+
},
116+
inningsStatus: "in_progress",
117+
target: null
118+
},
119+
second: {
120+
battingTeam: "IT",
121+
totalRuns: 0,
122+
over: 0.0,
123+
wicketsFallen: 0,
124+
Batting: {
125+
striker: null,
126+
nonStriker: null,
127+
order: []
128+
},
129+
Bowling: {
130+
bowler: null,
131+
currentOver: [],
132+
extras: {
133+
noBalls: 0,
134+
wides: 0,
135+
byes: 0,
136+
legByes: 0
137+
}
138+
},
139+
inningsStatus: "not_started",
140+
target: 57
141+
}
142+
},
143+
interrupted: "wet_outfield",
144+
teamACaptain: "CaptainA",
145+
teamBCaptain: "CaptainB",
146+
teamAWicketKeeper: "WicketKeeperA",
147+
teamBWicketKeeper: "WicketKeeperB",
148+
umpires: ["Umpire1", "Umpire2"],
149+
matchStatus: "in_progress",
150+
matchoutcome: [
151+
null, // EEE/IT/draw/no_result
152+
null, // run/wickets
153+
null // 32/4
154+
]
155+
}
156+
};
157+
158+
```
159+

state.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"State": {
3+
"innings": {
4+
"first": {
5+
"battingTeam": "EEE",
6+
"totalRuns": 56,
7+
"over": 5.5,
8+
"wicketsFallen": 4,
9+
10+
"Batting": {
11+
"striker": { "name": "PlayerA", "runs": 34, "outReason": null },
12+
"nonStriker": { "name": "PlayerD", "runs": 20, "outReason": null },
13+
"order": [
14+
{
15+
"name": "PlayerX",
16+
"runs": 0,
17+
"status": "out",
18+
"profileLink": "https://example.com/profile/playerx",
19+
"outReason": ["b", "Bowler1", null]
20+
},
21+
{
22+
"name": "PlayerY",
23+
"runs": 10,
24+
"status": "out",
25+
"profileLink": "https://example.com/profile/playery",
26+
"outReason": ["c", "Bowler2", "PlayerZ"]
27+
},
28+
{
29+
"name": "PlayerZ",
30+
"runs": 15,
31+
"status": "out",
32+
"profileLink": "https://example.com/profile/playerz",
33+
"outReason": ["run_out", null, "PlayerX"]
34+
},
35+
{
36+
"name": "PlayerB",
37+
"runs": 5,
38+
"status": "out",
39+
"profileLink": "https://example.com/profile/playerb",
40+
"outReason": ["st", "Bowler3", "WicketKeeperA"]
41+
},
42+
{
43+
"name": "PlayerA",
44+
"runs": 34,
45+
"status": "not out",
46+
"profileLink": "https://example.com/profile/playera",
47+
"outReason": null
48+
},
49+
{
50+
"name": "PlayerD",
51+
"runs": 20,
52+
"status": "not out",
53+
"profileLink": "https://example.com/profile/playerd",
54+
"outReason": null
55+
}
56+
]
57+
},
58+
59+
"Bowling": {
60+
"bowler": { "name": "Bowler1", "overs": 1.5, "runsConceded": 24, "wickets": 2 },
61+
"currentOver": [
62+
{ "ball": 1, "runs": 4, "illegal": null },
63+
{ "ball": 2, "runs": 0, "illegal": "no_ball" },
64+
{ "ball": 3, "runs": 1, "illegal": "free_hit_legal" },
65+
{ "ball": 4, "runs": 0, "illegal": null },
66+
{ "ball": 5, "runs": 6, "illegal": null },
67+
{ "ball": 6, "runs": 0, "illegal": null },
68+
{ "ball": 7, "runs": 0, "illegal": "wide" }
69+
],
70+
"order": [
71+
{ "name": "Bowler1", "overs": 1.5, "runsConceded": 15, "wickets": 2, "profileLink": "https://example.com/profile/bowler1" },
72+
{ "name": "Bowler2", "overs": 2.0, "runsConceded": 10, "wickets": 1, "profileLink": "https://example.com/profile/bowler2" },
73+
{ "name": "Bowler3", "overs": 2.0, "runsConceded": 20, "wickets": 1, "profileLink": "https://example.com/profile/bowler3" }
74+
],
75+
"extras": { "noBalls": 1, "wides": 2, "byes": 0, "legByes": 0 }
76+
},
77+
78+
"inningsStatus": "in_progress",
79+
"target": null
80+
},
81+
82+
"second": {
83+
"battingTeam": "IT",
84+
"totalRuns": 0,
85+
"over": 0.0,
86+
"wicketsFallen": 0,
87+
88+
"Batting": {
89+
"striker": null,
90+
"nonStriker": null,
91+
"order": []
92+
},
93+
94+
"Bowling": {
95+
"bowler": null,
96+
"currentOver": [],
97+
"extras": { "noBalls": 0, "wides": 0, "byes": 0, "legByes": 0 }
98+
},
99+
100+
"inningsStatus": "not_started",
101+
"target": 57
102+
}
103+
},
104+
105+
"interrupted": "wet_outfield",
106+
"teamACaptain": "CaptainA",
107+
"teamBCaptain": "CaptainB",
108+
"teamAWicketKeeper": "WicketKeeperA",
109+
"teamBWicketKeeper": "WicketKeeperB",
110+
"umpires": ["Umpire1", "Umpire2"],
111+
"matchStatus": "in_progress",
112+
"matchoutcome": ["EEE/IT/draw/no_result/null", "run/wickets/null", "32/4/null"]
113+
}
114+
}
115+

0 commit comments

Comments
 (0)