Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array.prototype.median = function (arr) {
- arr.sort((a, b) => a - b);
- var pivot = Math.floor(arr.length / 2);
- return arr.length % 2 ? arr[ pivot ] : (arr[ pivot - 1 ] + arr[ pivot ]) / 2;
- }
- class Median{
- constructor() {
- this.history = []
- }
- show(multiplier){
- this.history.push(multiplier)
- this.log(this.history.median(this.history))
- console.log(this.history.median(this.history))
- }
- }
- var median = new Median()
- while(true){
- const {multiplier} = await this.bet(100, 1.01)
- median.show(multiplier)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement