// Healthcare Futures Simulator - JavaScript Version
function introduction() {
alert(`Welcome to 'Healthcare Futures Simulator'!\n\nIn this game, you are a pharmaceutical executive shaping the future of healthcare over the next decade.\n\nYour goal is to balance Cost, Access, and Innovation while navigating unforeseen challenges.\n\nGood luck!`);
}
function displayMetrics(metrics) {
alert(`Current Metrics:\n\nCost: ${metrics.Cost} (Lower is better for affordability)\nAccess: ${metrics.Access} (Higher is better for patient access)\nInnovation: ${metrics.Innovation} (Higher is better for future treatments)`);
}
function makeDecision(year) {
const options = [
"Invest heavily in cutting-edge drug research (+Innovation, -Cost, -Access)",
"Reduce drug prices to improve affordability (-Innovation, +Access, +Cost)",
"Expand patient assistance programs (+Access, -Cost)",
"Lobby for extended patent protections (+Innovation, -Access)",
"Cut costs by reducing R&D investments (-Innovation, +Cost)"
];
let choice;
while (!choice || choice < 1 || choice > options.length) {
choice = parseInt(prompt(`Year ${year}: Choose your strategy:\n\n${options.map((option, index) => `${index + 1}. ${option}`).join('\n')}\n\nEnter the number of your choice:`));
}
return choice;
}
function applyDecision(choice, metrics) {
switch (choice) {
case 1: // Invest heavily in R&D
metrics.Innovation += 10;
metrics.Cost -= 5;
metrics.Access -= 5;
break;
case 2: // Reduce drug prices
metrics.Innovation -= 5;
metrics.Access += 10;
metrics.Cost += 10;
break;
case 3: // Expand patient assistance programs
metrics.Access += 10;
metrics.Cost -= 5;
break;
case 4: // Lobby for extended patents
metrics.Innovation += 10;
metrics.Access -= 5;
break;
case 5: // Cut R&D investments
metrics.Innovation -= 10;
metrics.Cost += 5;
break;
}
// Ensure metrics stay within bounds (0 to 100)
metrics.Cost = Math.min(100, Math.max(0, metrics.Cost));
metrics.Access = Math.min(100, Math.max(0, metrics.Access));
metrics.Innovation = Math.min(100, Math.max(0, metrics.Innovation));
return metrics;
}
function randomEvent(metrics) {
const events = [
{ message: "A breakthrough in AI reduces research costs (+Innovation, +Cost)", impact: { Innovation: 5, Cost: 5 } },
{ message: "A public backlash demands lower drug prices (-Cost, +Access, -Innovation)", impact: { Cost: -10, Access: 5, Innovation: -5 } },
{ message: "A global pandemic increases demand for your treatments (+Access, -Cost)", impact: { Access: 10, Cost: -5 } },
{ message: "Government regulations tighten, raising costs (-Cost, -Access)", impact: { Cost: -10, Access: -5 } },
{ message: "A competitor releases a groundbreaking new drug (-Access, -Innovation)", impact: { Access: -5, Innovation: -5 } }
];
const event = events[Math.floor(Math.random() * events.length)];
alert(`Random Event: ${event.message}`);
for (const key in event.impact) {
metrics[key] += event.impact[key];
}
// Ensure metrics stay within bounds (0 to 100)
metrics.Cost = Math.min(100, Math.max(0, metrics.Cost));
metrics.Access = Math.min(100, Math.max(0, metrics.Access));
metrics.Innovation = Math.min(100, Math.max(0, metrics.Innovation));
return metrics;
}
function main() {
introduction();
// Initialize metrics
let metrics = {
Cost: 50,
Access: 50,
Innovation: 50
};
// Game loop
for (let year = 1; year <= 10; year++) {
displayMetrics(metrics);
const choice = makeDecision(year);
metrics = applyDecision(choice, metrics);
metrics = randomEvent(metrics);
}
// End of game
alert(`Game Over!\n\nFinal Metrics:\n\nCost: ${metrics.Cost}\nAccess: ${metrics.Access}\nInnovation: ${metrics.Innovation}\n\nThank you for playing 'Healthcare Futures Simulator'! Reflect on the complexities of balancing patient access, affordability, and innovation.`);
}
main();
Health Care Game