Typescript, Poker Strategy, Poker Stories, Programming, Cardstack.
function calculateEV(actions: Action[]): number { let ev = 0; for (const action of actions) { ev += action.probability * action.outcome; } return ev; } // Example usage: const actions: Action[] = [ { name: "Call", probability: 0.5, outcome: 50 }, { name: "Fold", probability: 0.5, outcome: 0 }, ];