2 deleted 105 characters in body

# Charcoal, 277277 255 bytes

Ｆ¹¹⊞υＳ≔⮌Ｅυκθ≔Ｅυ⟦⟧η≔Ｅυ⁰δＷ⊖Ｌθ«≔⊟θι≔‽⁶ε⊞§ηιε≔⎇⁼ε⁴⁺²‽³⁼Ｌ§ηι³⁰ε¿ε§≔διε⊞θι¿⊖Ｌθ¿⁼¬﹪ΣＥηＬκ⁶¬εＦ⟦⊟θ⊟θ⟧⊞θκ»≔ＥηΣ⭆ι§120406λζ”|⁴Ｂ\[⎇⁻℅↧Ｔ\⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”Ｆ¹¹«◨§υι⁷◨⭆§ηι§12≔Ｅ¹¹⟦⟦⟧⁰Ｓ⟧θ≔⮌θηＷ⊖Ｌη«≔⊟ηι≔‽12.4/6κ³²§⪪”6ζ⊞υζ⊞§ι⁰ζ≔⎇⁼ζ/⁺²‽³⁼³⁰Ｌ§ι⁰ζ¿ζ§≔ι¹ζ⊞ηι¿⊖Ｌη¿⁼¬﹪Ｌυ⁶¬εＦ⟦⊟η⊟η⟧⊞ηκ»”|⁴Ｂ\[⎇⁻℅↧Ｔ⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”Ｆθ«◨⊟ι⁷◨Σ§ι⁰¦³²§⪪”(3⪪⪫⧴πＺJL:∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷§δι◧Ｉ§ζι⁶⸿⸿»”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣζ²⁸Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷⊟ι◧ＩΣＥ⊟ιΣκ⁶⸿⸿»”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣＥυΣι²⁸Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι


Try it online!Try it online! Link is to verbose version of code. Explanation:

Ｆ¹¹⊞υＳ≔Ｅ¹¹⟦⟦⟧⁰Ｓ⟧θ


Read in the 11 names. (Inputinput is flexible: JSON, space separated, or newline separated. 6 bytes could be saved) and create an array q of 11 batters, represented by requiring a double nested JSON format.their balls (as an array), status (as an integer) and name.

≔⮌Ｅυκθ≔⮌θη


Create an array q holdinga reversed copy of the numbersbatters 10..0h. This represents the batters that are not out. The last two elements are the off and current batters.

≔Ｅυ⟦⟧η


Create an array h holding the batter's balls.

≔Ｅυ⁰δ


Create an array d representing the batter's status.

Ｗ⊖Ｌθ«Ｗ⊖Ｌη«


Repeat while there are at least two batters available.

≔⊟θι≔⊟ηι


Extract the current batter to i.

≔‽⁶ε≔‽12.4/6ζ


Generate a random ball in ez.

⊞υζ


Add it to the overall list of balls using the predefined empty list (0-indexed)u.

⊞§ηιε⊞§ι⁰ζ


Add it to the current batter's balls.

≔⎇⁼ε⁵⁺²‽³⁼Ｌ§ηι³⁰ε≔⎇⁼ζ/⁺²‽³⁼³⁰Ｌ§ι⁰ζ


If the ball is a 5/, then generate a random status 2..4, otherwise if this is the batter's 30th ball then set the status to 1 otherwise 0.

¿ε§≔διε⊞θι¿ζ§≔ι¹ζ⊞ηι


If the batter is out then store the batter's status otherwise put the batter back in to bat.

¿⊖Ｌθ¿⁼¬﹪ΣＥηＬκ⁶¬ε¿⊖Ｌθ¿⁼¬﹪ΣＥηＬκ⁶¬ζ


If there are at least two batters left, and the batter was out xor 6 balls have been played, then...

Ｆ⟦⊟θ⊟θ⟧⊞θκ»Ｆ⟦⊟η⊟η⟧⊞ηκ»


...take the off and current batters and put them back in reverse order.

≔ＥηΣ⭆ι§120406λζ


Map each ball to its score and take the total for each batter in array z.

”|⁴Ｂ\[⎇⁻℅↧Ｔ⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”


Ｆ¹¹«Ｆθ«


Loop over the batters.

◨§υι⁷◨⊟ι⁷


Print the batter's name.

◨⭆§ηι§12.4/6κ³²◨Σ§ι⁰¦³²


Print the batter's balls.

§⪪”(3⪪⪫⧴πＺJL:∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷§δι∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷⊟ι


Print the batter's status by indexing into the string Not OutRetiredBowled Caught LBW split into substrings of length 7.

◧Ｉ§ζι⁶◧ＩΣＥ⊟ιΣκ⁶


Print the batter's score.

⸿⸿»


Move to the start of the next line but one.

”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣζ²⁸”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣＥυΣι²⁸


Print the total.

Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι


Draw boxes around everything.

# Charcoal, 277 bytes

Ｆ¹¹⊞υＳ≔⮌Ｅυκθ≔Ｅυ⟦⟧η≔Ｅυ⁰δＷ⊖Ｌθ«≔⊟θι≔‽⁶ε⊞§ηιε≔⎇⁼ε⁴⁺²‽³⁼Ｌ§ηι³⁰ε¿ε§≔διε⊞θι¿⊖Ｌθ¿⁼¬﹪ΣＥηＬκ⁶¬εＦ⟦⊟θ⊟θ⟧⊞θκ»≔ＥηΣ⭆ι§120406λζ”|⁴Ｂ\[⎇⁻℅↧Ｔ\⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”Ｆ¹¹«◨§υι⁷◨⭆§ηι§12.4/6κ³²§⪪”(3⪪⪫⧴πＺJL:∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷§δι◧Ｉ§ζι⁶⸿⸿»”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣζ²⁸Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι


Try it online! Link is to verbose version of code. Explanation:

Ｆ¹¹⊞υＳ


Read in the 11 names. (Input is flexible: JSON, space separated, or newline separated. 6 bytes could be saved by requiring a double nested JSON format.)

≔⮌Ｅυκθ


Create an array q holding the numbers 10..0. This represents the batters. The last two elements are the off and current batters.

≔Ｅυ⟦⟧η


Create an array h holding the batter's balls.

≔Ｅυ⁰δ


Create an array d representing the batter's status.

Ｗ⊖Ｌθ«


Repeat while there are at least two batters available.

≔⊟θι


Extract the current batter.

≔‽⁶ε


Generate a random ball in e (0-indexed).

⊞§ηιε


Add it to the current batter's balls.

≔⎇⁼ε⁵⁺²‽³⁼Ｌ§ηι³⁰ε


If the ball is a 5, then generate a random status 2..4, otherwise if this is the batter's 30th ball then set the status to 1 otherwise 0.

¿ε§≔διε⊞θι


If the batter is out then store the batter's status otherwise put the batter back in to bat.

¿⊖Ｌθ¿⁼¬﹪ΣＥηＬκ⁶¬ε


If there are at least two batters left, and the batter was out xor 6 balls have been played, then...

Ｆ⟦⊟θ⊟θ⟧⊞θκ»


...take the off and current batters and put them back in reverse order.

≔ＥηΣ⭆ι§120406λζ


Map each ball to its score and take the total for each batter in array z.

”|⁴Ｂ\[⎇⁻℅↧Ｔ⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”


Ｆ¹¹«


Loop over the batters.

◨§υι⁷


Print the batter's name.

◨⭆§ηι§12.4/6κ³²


Print the batter's balls.

§⪪”(3⪪⪫⧴πＺJL:∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷§δι


Print the batter's status by indexing into the string Not OutRetiredBowled Caught LBW split into substrings of length 7.

◧Ｉ§ζι⁶


Print the batter's score.

⸿⸿»


Move to the start of the next line but one.

”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣζ²⁸


Print the total.

Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι


Draw boxes around everything.

# Charcoal, 277 255 bytes

≔Ｅ¹¹⟦⟦⟧⁰Ｓ⟧θ≔⮌θηＷ⊖Ｌη«≔⊟ηι≔‽12.4/6ζ⊞υζ⊞§ι⁰ζ≔⎇⁼ζ/⁺²‽³⁼³⁰Ｌ§ι⁰ζ¿ζ§≔ι¹ζ⊞ηι¿⊖Ｌη¿⁼¬﹪Ｌυ⁶¬εＦ⟦⊟η⊟η⟧⊞ηκ»”|⁴Ｂ\[⎇⁻℅↧Ｔ⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”Ｆθ«◨⊟ι⁷◨Σ§ι⁰¦³²§⪪”(3⪪⪫⧴πＺJL:∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷⊟ι◧ＩΣＥ⊟ιΣκ⁶⸿⸿»”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣＥυΣι²⁸Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι


Try it online! Link is to verbose version of code. Explanation:

≔Ｅ¹¹⟦⟦⟧⁰Ｓ⟧θ


Read in the 11 names (input is flexible: JSON, space separated, or newline separated) and create an array q of 11 batters, represented by their balls (as an array), status (as an integer) and name.

≔⮌θη


Create a reversed copy of the batters h. This represents the batters that are not out. The last two elements are the off and current batters.

Ｗ⊖Ｌη«


Repeat while there are at least two batters available.

≔⊟ηι


Extract the current batter to i.

≔‽12.4/6ζ


Generate a random ball in z.

⊞υζ


Add it to the overall list of balls using the predefined empty list u.

⊞§ι⁰ζ


Add it to the current batter's balls.

≔⎇⁼ζ/⁺²‽³⁼³⁰Ｌ§ι⁰ζ


If the ball is a /, then generate a random status 2..4, otherwise if this is the batter's 30th ball then set the status to 1 otherwise 0.

¿ζ§≔ι¹ζ⊞ηι


If the batter is out then store the batter's status otherwise put the batter back in to bat.

¿⊖Ｌθ¿⁼¬﹪ΣＥηＬκ⁶¬ζ


If there are at least two batters left, and the batter was out xor 6 balls have been played, then...

Ｆ⟦⊟η⊟η⟧⊞ηκ»


...take the off and current batters and put them back in reverse order.

”|⁴Ｂ\[⎇⁻℅↧Ｔ⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”


Ｆθ«


Loop over the batters.

◨⊟ι⁷


Print the batter's name.

◨Σ§ι⁰¦³²


Print the batter's balls.

§⪪”(3⪪⪫⧴πＺJL:∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷⊟ι


Print the batter's status by indexing into the string Not OutRetiredBowled Caught LBW split into substrings of length 7.

◧ＩΣＥ⊟ιΣκ⁶


Print the batter's score.

⸿⸿»


Move to the start of the next line but one.

”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣＥυΣι²⁸


Print the total.

Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι


Draw boxes around everything.

1

# Charcoal, 277 bytes

Ｆ¹¹⊞υＳ≔⮌Ｅυκθ≔Ｅυ⟦⟧η≔Ｅυ⁰δＷ⊖Ｌθ«≔⊟θι≔‽⁶ε⊞§ηιε≔⎇⁼ε⁴⁺²‽³⁼Ｌ§ηι³⁰ε¿ε§≔διε⊞θι¿⊖Ｌθ¿⁼¬﹪ΣＥηＬκ⁶¬εＦ⟦⊟θ⊟θ⟧⊞θκ»≔ＥηΣ⭆ι§120406λζ”|⁴Ｂ\[⎇⁻℅↧Ｔ\⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”Ｆ¹¹«◨§υι⁷◨⭆§ηι§12.4/6κ³²§⪪”(3⪪⪫⧴πＺJL:∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷§δι◧Ｉ§ζι⁶⸿⸿»”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣζ²⁸Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι


Try it online! Link is to verbose version of code. Explanation:

Ｆ¹¹⊞υＳ


Read in the 11 names. (Input is flexible: JSON, space separated, or newline separated. 6 bytes could be saved by requiring a double nested JSON format.)

≔⮌Ｅυκθ


Create an array q holding the numbers 10..0. This represents the batters. The last two elements are the off and current batters.

≔Ｅυ⟦⟧η


Create an array h holding the batter's balls.

≔Ｅυ⁰δ


Create an array d representing the batter's status.

Ｗ⊖Ｌθ«


Repeat while there are at least two batters available.

≔⊟θι


Extract the current batter.

≔‽⁶ε


Generate a random ball in e (0-indexed).

⊞§ηιε


Add it to the current batter's balls.

≔⎇⁼ε⁵⁺²‽³⁼Ｌ§ηι³⁰ε


If the ball is a 5, then generate a random status 2..4, otherwise if this is the batter's 30th ball then set the status to 1 otherwise 0.

¿ε§≔διε⊞θι


If the batter is out then store the batter's status otherwise put the batter back in to bat.

¿⊖Ｌθ¿⁼¬﹪ΣＥηＬκ⁶¬ε


If there are at least two batters left, and the batter was out xor 6 balls have been played, then...

Ｆ⟦⊟θ⊟θ⟧⊞θκ»


...take the off and current batters and put them back in reverse order.

≔ＥηΣ⭆ι§120406λζ


Map each ball to its score and take the total for each batter in array z.

”|⁴Ｂ\[⎇⁻℅↧Ｔ⁵·5ＫＭＫ⟲M≦»→´⁶_⭆∨Ｒ▷↥l⁹KＧ…≦”


Ｆ¹¹«


Loop over the batters.

◨§υι⁷


Print the batter's name.

◨⭆§ηι§12.4/6κ³²


Print the batter's balls.

§⪪”(3⪪⪫⧴πＺJL:∨ＸＩ±ＵＲＤ↗Σ9⟦FZ∕↖l⪪”⁷§δι


Print the batter's status by indexing into the string Not OutRetiredBowled Caught LBW split into substrings of length 7.

◧Ｉ§ζι⁶


Print the batter's score.

⸿⸿»


Move to the start of the next line but one.

”|ＱºWＰD⟧zＮφ[v？Π'vＧ”◧ＩΣζ²⁸


Print the total.

Ｊ±¹±¹ＦＥ¹³⁻²⁷⊗ι«Ｂ⁵⁵ιＢ⁴⁹ι¿‹ι²⁷«Ｂ³⁹ιＢ⁸ι
`

Draw boxes around everything.