Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ball Basic Athletic Logic Language. T he T eam Cipta Herwana - Project Manager Daniel Lasry - Language Guru Nathan Miller - System Architect Sam Lee -

Similar presentations


Presentation on theme: "Ball Basic Athletic Logic Language. T he T eam Cipta Herwana - Project Manager Daniel Lasry - Language Guru Nathan Miller - System Architect Sam Lee -"— Presentation transcript:

1 Ball Basic Athletic Logic Language

2 T he T eam Cipta Herwana - Project Manager Daniel Lasry - Language Guru Nathan Miller - System Architect Sam Lee - System Integrator Jordan Schau - Tester and Validator

3 W hat i s Ball? Ball is a language designed to facilitate the simulation of Baseball games for the layman. Ball is an imperative and interpreted programming language. Ball is built on the efficiencies and powerful toolset of Java.

4 W ho c an u se Ball Baseball Fans Baseball Managers Little League Parents Sports Bettors

5 O bjective Create our own custom Simulation functions with ease.Streamline the process. Omit obfuscating details: Scoping Strong Typing Irrelevant Declarations

6 C ustom S imulations Create a simulation function. Activate! Call sim(team1, team2, times) simfunction simpleSim is: if (team1’s W > team2’s W) then: return team1; else: return team2; end activate simpleSim; sim(Dodgers, Yankees, 5);

7 S treamlined P rocess Straightforward loading and management of teams. Simple stat declaration and manipulation. Easy filtering, sorting and selecting from teams. stat bWalk = BB / PA; stat bSingle = (Hits - (2B +3B + HR)) / PA; stat bDouble = 2B / PA; stat bTriple = 3B / PA; stat bHR = HR / PA; team Dodgers = load("dodgers.team"); player Manny = "Manny Ramirez" from Dodgers; print Manny’s bHR; list 300hitters = Dodgers where (avg >.300);

8 E ase o f P rogramming Scope: Functions declared anywhere in the body can be called anywhere! Users do not need to understand scopes. Typing: ‘number’ covers integers and decimals. ‘list, ‘player’ and ‘team’ types. Irrelevant Declarations: No need to declare a main class and function. Simple loops and conditionals print "play ball"; number anInteger = 5; number aDecimal = 2.34; list aList = [team1, team2, team3]; list aList = [3, 4, 5]; function setProb() returns nothing: probWalk = 2; probSingle = 3; probDouble = 4; end

9 T OOLS U SED Byacc/J Google Code Subversion JFlex Ubuntu Eclipse

10 C ompiler S tructure Lexer Source Program Symbo l Table Parser Progra m Progra m Expressio n Expressio n Declaration Declaration Print Print Jump Jump Condition al Condition al Syntax Tree Java Source Java Compile r JVMJVM JVMJVM Compiler Front-end Runtim e Classes

11 E xample P rogram simfunction simpleSim is: if (team1’s W > team2’s W) then: return team1; else: return team2; end activate simpleSim; //activates the simpleSim function team Indians = load(“Indians.team”); team Orioles = load(“Orioles.team”); print "Winner: " + sim(Indians, Orioles, 1);

12 T esting Test Driven Development White Box Testing Regression Testing Unit Testing Accuracy Testing Real Results vs Predicted Results

13 C onclusion Why BALL? Simple Lightweight Accurate Fun :)

14 /*Set the global probabilities of this inning*/ combineProb(batter, pitcher); randomizeProbabilities(); team1Score += probWalk*(1/4) + probSingle*(1/4) + probDouble*(2/4) + probTriple*(3/4) + probHR; end /*NOW, team2 is batting and team1 is pitching! (5 times)*/ do 5 times: list bestBatters2 = top(9, team2 where (type is "batter"), AVG); player batter = any bestBatters2; list bestPitchers2 = bottom(4, team1 where (type is "pitcher"), ERA); player pitcher = any bestPitchers2; player batter = any team2 where (type is "batter" and AVG is top 5); player pitcher = any team1 where (type is "pitcher" and ERA is lowest 5); combineProb(batter, pitcher); randomizeProbabilities(); team2Score += probWalk*(1/4) + probSingle*(1/4) + probDouble*(2/4) + probTriple*(3/4) + probHR; end if (team1Score > team2Score) then: print "Team " + team1’s name + " wins against team " + team2’s name + "!!"; return team1; else: print "Team " + team2’s name + " wins against team " + team1’s name + "!!"; return team2; end /*END BASIC SIMULATION FUNCTION*/ stat bWalk = BB / PA; stat bSingle = (Hits - (2B + 3B + HR))/ PA; stat bDouble = 2B / PA; stat bTriple = 3B / PA; stat bHR = HR / PA; /*Pitcher probabilities*/ stat pWalk = BB / BF; stat pSingle = (Hits / BF) - pHR - pTriple - pDouble; stat pDouble = Hits x.174 / BF; stat pTriple = Hits x.024 / BF; stat pHR = HR / BF; /***END STATS DEFINITION***/ /*****************************************************/ /*Global variables that hold combined probabilities given a pitcher and a batter*/ number probWalk = 0; number probSingle = 0; number probDouble = 0; number probTriple = 0; number probHR = 0; simfunction basicSimulation is: number team1Score = 0; number team2Score = 0; do 5 times: /*Select random players from the best 5 of each team*/ list bestBatters = top(9, team1 where (type is "batter"), AVG); player batter = any bestBatters; list bestPitchers = bottom(4, team2 where (type is "pitcher"), ERA); player pitcher = any bestPitchers; C omplex S imulation

15


Download ppt "Ball Basic Athletic Logic Language. T he T eam Cipta Herwana - Project Manager Daniel Lasry - Language Guru Nathan Miller - System Architect Sam Lee -"

Similar presentations


Ads by Google