Skip to content

Instantly share code, notes, and snippets.

@jkresner
Created September 9, 2015 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkresner/b2db5c927e6a526ec5ba to your computer and use it in GitHub Desktop.
Save jkresner/b2db5c927e6a526ec5ba to your computer and use it in GitHub Desktop.
var operation = {
'Imperial shuttle': 5,
'Theta-class T-2c shuttle': 10,
'Sentinel-class landing craft': 2
};
// How many civilians can be transported in an emergency escape operation?
var civilians = 0;
for (var startship of starships)
if (starship.name in operation)
civilians += operation[starship.name] * parseInt(starship.passengers, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment