Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created April 8, 2013 15:49
Show Gist options
  • Save ynonp/5337867 to your computer and use it in GitHub Desktop.
Save ynonp/5337867 to your computer and use it in GitHub Desktop.
package bp.logic;
class BPResult {
int bulls;
int cows;
bool is_winner() { ... }
BPResult( int bulls, int cows) {}
}
(function(global) {
global.bp.logic.BPResult = function( bulls, cows ) {
var self = this;
self.bulls = bulls;
self.cows = cows;
self.is_winner = function() {
return self.bulls === 4;
};
};
}(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment