PhanaticScript

From Esolang
Jump to navigation Jump to search

The language that reads like a Phillies game by Aiden Mastronardo.



Commands
The play is in right field.
Move the pointer to the right by 1. Move one more for each descriptor (i.e. deep, shallow)

The play is in left field.
Move the pointer to the left by 1. Move one more for each descriptor (i.e. deep, shallow)

Phillies batter walks or singles.
Increment the memory cell at the pointer by 1. Add one for each base (Double = 2, Triple = 3, HR = 4, GS = 10)

Phillies pitcher records an out.
Increment the memory cell at the pointer. (Flyout = 1, Groundout/Lineout = 2, K Swinging = 3, K Looking =4, GIDP/Pick off = 5)

Phillies batter gets out.
Decrement the memory cell at the pointer. (Flyout = 1, Groundout/Lineout = 2, K Swinging = 3, K Looking = 4, GIDP/ Caught Stealing= 5)

Phillies pitcher records a walk or hit.
Decrement the memory cell at the pointer. (Single/Walk = 1, Double = 2, Triple = 3, HR = 4, GS = 10)

Announcer/Broadcaster says something.
Output the character signified by the cell at the pointer

The fans get loud.
Input a character and store it in the cell at the pointer

The Phanatic does something (Rides ATV, dances, celebrates)
Jump past the matching phanatic statement if the cell at the pointer is 0

The Phanatic takes a break and heads inside.
Jump back to the matching phanatic statement if the cell at the pointer is nonzero

The play is replayed on the jumbotron.
If nothing in register, copy value from current memory cell. If register contains a value, paste value into current memory cell.



Rules/Regulations for interpreting
Roster and announcers must be set at the top of the program. Batters must go to the plate in order.
Every time the score changes it must be updated. Same thing for outs.
Baserunners move according to most likely scenario. Sacrifice flies only for runs are possible.
Ground-into-double-play can only happen if there is another player on the bases.
Every three outs, the team switches between offense and defense.
After every six outs, a new inning starts. If nine innings are not played, the game must rainout.
The score must be correctly calculated at the end and if the Phillies do not win, the program has a 100% chance of crashing.



Map to BF
'>' | The play is in right field.
'<' | The play is in left field.
'+' | Phillies batter walks or singles.
'+' | Phillies pitcher records an out.
'-' | Phillies batter gets out.
'-' | Phillies pitcher records a walk or hit.
'.' | Announcer/Broadcaster says something.
',' | The fans get loud.
'[' | The Phanatic does something (Rides ATV, dances, celebrates)
']' | The Phanatic takes a break and heads inside.



Example program #1 Prints out "Go Phils"

Announcers: Tom McCarthy, John Kruk

Roster:
P: Zack Wheeler

1. Trea Turner, SS
2. Bryson Stott, 2B
3. Bryce Harper, 1B
4. Kyle Schwarber, DH
5. Nick Castellanos, RF
6. Alec Bohm, 3B
7. Max Kepler, LF
8. J.T. Realmuto, C
9. Brandon Marsh, CF

First Inning
Zack Wheeler strikes out the batter looking (1 out).
Zack Wheeler records a backwards 'K' (2 outs). #C0 = 8
The Phanatic rides out on an ATV.
The play is in right field.
Zack Wheeler gets the batter looking (3 outs). #Add 4 to C1 will reset in following loop
The Phanatic dances on the dugout.
The play is in right field.
Trea Turner hits a double. #Add 4*2 to C2
The play is in right field.
Bryson Stott hits a triple, Trea Turner scores. 1-0 Phillies. #Add 4*3 to C3
The play is in right field.
Bryce Harper singles, Bryson Stott scores. 2-0 Phillies. #Add 4 to C4
The play is in deep, deep left field. #Move back to C1
Kyle Schwarber flies out (1 out). #Decrement loop counter in C1
The Phanatic takes a break. #Loop until C1 = 0
The play is in right field.
Nick Castellanos hits a single. #Add 1 to C2
The play is in right field.
Alec Bohm hits a double, Bryce Harper scores. 3-0 Phillies #Add 2 to C3
The play is in deep, deep left field.
J.T. Realmuto flies out, Nick Castellanos scores (2 outs). 4-0 Phillies #Decrement loop counter in C0
The Phanatic heads inside. #(End second loop C2 = 72, C3 = 112,C4 = 32)
The play is in deep right field.
Brandon Marsh flies out (3 outs). #Subtract 1 from C2

Second Inning
John Kruk tells a prison baseball story. #Output 'G'
The play is in right field.
Zack Wheeler walks the batter. #Subtract 1 from C3
Tom McCarthy talks pitch mechanics. #Output 'o'
The play is in right field.
John Kruk scares a kid looking into the broadcasting booth. #Output ' '
The play is in left field.
Zack Wheeler pitches and the result is a ground into double play. (2 outs). #Add 5 to C2
Zack Wheeler gets another backwards 'K' (3 outs). #Add 4 to C2
Tom McCarthy calls the end of the half inning. #Output 'P'
The play is in right field.
Trea Turner strikes out looking (1 out). #Subtract 4 from C3
Bryson Strikes out swinging (2 outs). #Subtract 3 from C3
Tom McCarthy compliments the opposing pitcher. #Output 'h'
Bryce Harper hits a single.
John Kruk is reminded of his days as a Phillie. #Output 'i'
Kyle Schwarber hits a triple, Bryce Harper scores. 4-0 Phillies
Tom McCarthy can't believe what he is seeing. #Output 'l'
Nick Castellanos hits a home run, two runs score. 6-0 Phillies
Alec Bohm hits a home run. 7-0 Phillies
John Kruk is saying how beautiful this team is. #Output 's'

The game rains out.

Final score: 7-0 Phillies



Example program #2 Hello World!

Announcers: Tom McCarthy, John Kruk

Roster:
P: Zack Wheeler

1. Trea Turner, SS
2. Bryson Stott, 2B
3. Bryce Harper, 1B
4. Kyle Schwarber, DH
5. Nick Castellanos, RF
6. Alec Bohm, 3B
7. Max Kepler, LF
8. J.T. Realmuto, C
9. Brandon Marsh, CF

First Inning
Zack Wheeler strikes out the batter looking (1 out).
Zack Wheeler records a backwards 'K' (2 outs). #C0 = 8
The Phanatic rides out on an ATV.
The play is in right field.
Zack Wheeler gets the batter looking (3 outs). #Add 4 to C1 will reset in following loop
The Phanatic dances on the dugout.
The play is in right field.
Trea Turner hits a double. #Add 4*2 to C2
Bryson Stott hits a triple, Trea Turner scores. 1-0 Phillies. #Add 4*3 to C3
The play is in right field.
Bryce Harper hits a triple, Bryson Stott scores. 2-0 Phillies. #Add 4*3 to C4
The play is in right field.
Kyle Schwarber walks. #Add 4 to C5
The play is in shallow, shallow, shallow left field.
Nick Castellanos flies out, Bryce Harper scores on a sacrifice. 3-0 Phillies. (1 out) #Decrement the loop counter by 1
The Phanatic goes inside. #Loop until C1 is zero
The play is in right field.
Alec Bohm walks. #Add 1 to C2
The play is in right field.
Max Kepler walks. #Add 1 to C3
The play is right field.
J.T. Realmuto flies out, Kyle Schwarber scores on a sacrifice. 4-0 Phillies. (2 outs) #Subtract 1 from C4
The play is in deep right field.
Brandon Marsh walks. #Add 1 to C6
The Phanatic brings out a t-shirt gun.
The play is in left field.
The Phanatic takes a break. #Move back to the first zero cell you find; this will be C1 which was cleared by the previous loop
The play is in left field.
Trea Turner flies out. (3 outs) # Decrement the loop Counter in C0
The Phanatic takes a break. # Loop till Cell #0 is zero
.#The result of this is: Cell No : 0 1 2 3 4 5 6
.# Contents: 0 0 72 104 88 32 8
.# Pointer : ^

Second Inning
The play is in deep right field.
John Kruk tells a prison baseball story. # C2 has value 72 which is 'H'
The play is in right field.
Zack Wheeler pitches and a triple is scored.
Tom McCarthy gives the play-by play. #Subtract 3 from C3 to get 101 which is 'e'
Zack Wheeler picks off the man on third. (1 out)
Zack Wheeler records a lineout. (2 outs)
John Kruk hoots and hollers.
Tom McCarthy laughs at John. # Add 7 and print out 'l' twice
Zack Wheeler gets the batter swinging. (3 outs)
Tom McCarthy commends the pitcher for getting out of a sticky situation. #Print 'o'
The play is in deep right field.
John Kruk remembers his days as a Phillie. #C5 is 32 for space
The play is in left field.
Bryson Stott flies out. (1 out)
Tom McCarthy talks about a special going on at the park. #Subtract 1 from C4 for 87 to give a 'W'
The play is in left field.
John Kruk sings Dancing On My Own. # C3 was set to 'o' from the end of 'Hello'
Bryce Harper hits a triple.
Tom McCarthy reads off Bryce's stats. #C3 for 'r'
Kyle Schwarber strikes out looking. (1 out)
Nick Castellanos lines out. (2 outs)
Tom McCarthy reads off a stat about men left on base. #C3 for 'l'
Bryce Harper gets picked off at third. (3 outs)

Third Inning
Zack Wheeler lets in a leadoff triple.
John Kruk talks about how baseball is different from 30 years ago. #C3 for 'd'
The play is in deep right field.
Zack Wheeler records a flyout, the runner scores on a sacrifice. 4-1 Phillies.
Tom McCarthy talks about the away team. # Add 1 to C5 gives us an exclamation point

The game rains out.

Final score: 4-1 Phillies