Skip to content

Commit

Permalink
vault backup: 2024-12-25 21:28:49
Browse files Browse the repository at this point in the history
  • Loading branch information
majorbruteforce committed Dec 25, 2024
1 parent f5fd585 commit 11674f5
Show file tree
Hide file tree
Showing 2 changed files with 274 additions and 0 deletions.
159 changes: 159 additions & 0 deletions MatchState.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
A state is a set of variables that describe the current state of a match. They are governed by match format.

Match state for cricket might look like this:

```javascript
const matchState = {
State: {
innings: {
first: {
battingTeam: "EEE",
totalRuns: 56,
over: 5.5,
wicketsFallen: 4,
Batting: {
striker: {
name: "PlayerA",
runs: 34,
outReason: null
},
nonStriker: {
name: "PlayerD",
runs: 20,
outReason: null
},
order: [
{
name: "PlayerX",
runs: 0,
status: "out",
profileLink: "https://example.com/profile/playerx",
outReason: ["b", "Bowler1", null]
},
{
name: "PlayerY",
runs: 10,
status: "out",
profileLink: "https://example.com/profile/playery",
outReason: ["c", "Bowler2", "PlayerZ"]
},
{
name: "PlayerZ",
runs: 15,
status: "out",
profileLink: "https://example.com/profile/playerz",
outReason: ["run_out", null, "PlayerX"]
},
{
name: "PlayerB",
runs: 5,
status: "out",
profileLink: "https://example.com/profile/playerb",
outReason: ["st", "Bowler3", "WicketKeeperA"]
},
{
name: "PlayerA",
runs: 34,
status: "not out",
profileLink: "https://example.com/profile/playera",
outReason: null
},
{
name: "PlayerD",
runs: 20,
status: "not out",
profileLink: "https://example.com/profile/playerd",
outReason: null
}
]
},
Bowling: {
bowler: {
name: "Bowler1",
overs: 1.5,
runsConceded: 24,
wickets: 2
},
currentOver: [
{ ball: 1, runs: 4, illegal: null },
{ ball: 2, runs: 0, illegal: "no_ball" },
{ ball: 3, runs: 1, illegal: "free_hit_legal" },
{ ball: 4, runs: 0, illegal: null },
{ ball: 5, runs: 6, illegal: null },
{ ball: 6, runs: 0, illegal: null },
{ ball: 7, runs: 0, illegal: "wide" }
],
order: [
{
name: "Bowler1",
overs: 1.5,
runsConceded: 15,
wickets: 2,
profileLink: "https://example.com/profile/bowler1"
},
{
name: "Bowler2",
overs: 2.0,
runsConceded: 10,
wickets: 1,
profileLink: "https://example.com/profile/bowler2"
},
{
name: "Bowler3",
overs: 2.0,
runsConceded: 20,
wickets: 1,
profileLink: "https://example.com/profile/bowler3"
}
],
extras: {
noBalls: 1,
wides: 2,
byes: 0,
legByes: 0
}
},
inningsStatus: "in_progress",
target: null
},
second: {
battingTeam: "IT",
totalRuns: 0,
over: 0.0,
wicketsFallen: 0,
Batting: {
striker: null,
nonStriker: null,
order: []
},
Bowling: {
bowler: null,
currentOver: [],
extras: {
noBalls: 0,
wides: 0,
byes: 0,
legByes: 0
}
},
inningsStatus: "not_started",
target: 57
}
},
interrupted: "wet_outfield",
teamACaptain: "CaptainA",
teamBCaptain: "CaptainB",
teamAWicketKeeper: "WicketKeeperA",
teamBWicketKeeper: "WicketKeeperB",
umpires: ["Umpire1", "Umpire2"],
matchStatus: "in_progress",
matchoutcome: [
null, // EEE/IT/draw/no_result
null, // run/wickets
null // 32/4
]
}
};

```

115 changes: 115 additions & 0 deletions state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"State": {
"innings": {
"first": {
"battingTeam": "EEE",
"totalRuns": 56,
"over": 5.5,
"wicketsFallen": 4,

"Batting": {
"striker": { "name": "PlayerA", "runs": 34, "outReason": null },
"nonStriker": { "name": "PlayerD", "runs": 20, "outReason": null },
"order": [
{
"name": "PlayerX",
"runs": 0,
"status": "out",
"profileLink": "https://example.com/profile/playerx",
"outReason": ["b", "Bowler1", null]
},
{
"name": "PlayerY",
"runs": 10,
"status": "out",
"profileLink": "https://example.com/profile/playery",
"outReason": ["c", "Bowler2", "PlayerZ"]
},
{
"name": "PlayerZ",
"runs": 15,
"status": "out",
"profileLink": "https://example.com/profile/playerz",
"outReason": ["run_out", null, "PlayerX"]
},
{
"name": "PlayerB",
"runs": 5,
"status": "out",
"profileLink": "https://example.com/profile/playerb",
"outReason": ["st", "Bowler3", "WicketKeeperA"]
},
{
"name": "PlayerA",
"runs": 34,
"status": "not out",
"profileLink": "https://example.com/profile/playera",
"outReason": null
},
{
"name": "PlayerD",
"runs": 20,
"status": "not out",
"profileLink": "https://example.com/profile/playerd",
"outReason": null
}
]
},

"Bowling": {
"bowler": { "name": "Bowler1", "overs": 1.5, "runsConceded": 24, "wickets": 2 },
"currentOver": [
{ "ball": 1, "runs": 4, "illegal": null },
{ "ball": 2, "runs": 0, "illegal": "no_ball" },
{ "ball": 3, "runs": 1, "illegal": "free_hit_legal" },
{ "ball": 4, "runs": 0, "illegal": null },
{ "ball": 5, "runs": 6, "illegal": null },
{ "ball": 6, "runs": 0, "illegal": null },
{ "ball": 7, "runs": 0, "illegal": "wide" }
],
"order": [
{ "name": "Bowler1", "overs": 1.5, "runsConceded": 15, "wickets": 2, "profileLink": "https://example.com/profile/bowler1" },
{ "name": "Bowler2", "overs": 2.0, "runsConceded": 10, "wickets": 1, "profileLink": "https://example.com/profile/bowler2" },
{ "name": "Bowler3", "overs": 2.0, "runsConceded": 20, "wickets": 1, "profileLink": "https://example.com/profile/bowler3" }
],
"extras": { "noBalls": 1, "wides": 2, "byes": 0, "legByes": 0 }
},

"inningsStatus": "in_progress",
"target": null
},

"second": {
"battingTeam": "IT",
"totalRuns": 0,
"over": 0.0,
"wicketsFallen": 0,

"Batting": {
"striker": null,
"nonStriker": null,
"order": []
},

"Bowling": {
"bowler": null,
"currentOver": [],
"extras": { "noBalls": 0, "wides": 0, "byes": 0, "legByes": 0 }
},

"inningsStatus": "not_started",
"target": 57
}
},

"interrupted": "wet_outfield",
"teamACaptain": "CaptainA",
"teamBCaptain": "CaptainB",
"teamAWicketKeeper": "WicketKeeperA",
"teamBWicketKeeper": "WicketKeeperB",
"umpires": ["Umpire1", "Umpire2"],
"matchStatus": "in_progress",
"matchoutcome": ["EEE/IT/draw/no_result/null", "run/wickets/null", "32/4/null"]
}
}

0 comments on commit 11674f5

Please sign in to comment.