cute golf support

This commit is contained in:
Peter Cottle 2013-01-06 00:10:33 -08:00
parent 662ecf0949
commit a5c0480962
7 changed files with 220 additions and 31 deletions

View file

@ -358,13 +358,32 @@ var NextLevelConfirm = ConfirmCancelTerminal.extend({
initialize: function(options) {
options = options || {};
this.nextLevelName = options.nextLevelName || 'The mysterious next level';
var markdowns = [
'## Great Job!!',
'',
'You solved the level in **' + options.numCommands + '** command(s); ',
'our solution uses ' + options.best + '. '
];
if (options.numCommands <= options.best) {
markdowns.push(
'Awesome! You matched or exceeded our solution. '
);
} else {
markdowns.push(
'See if you can whittle it down to ' + options.best + ' command(s) :D '
);
}
markdowns = markdowns.concat([
'',
'Would you like to move onto "',
this.nextLevelName + '", the next level?'
]);
options.modalAlert = {
markdowns: [
'## Great Job!!',
'',
'You solved the level. Would you like to move onto "',
this.nextLevelName + '", the next level?'
]
markdowns: markdowns
};
ConfirmCancelTerminal.prototype.initialize.apply(this, [options]);