This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///<reference path='app.d.ts' /> | |
import fs = module("fs") | |
import _ = module("underscore") | |
import winston = module("winston") | |
import async = module("async") | |
var s = require('string'); | |
// Usage: node appname input-file [output-file] [test] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick-and-Dirty Brute Force Risk vs Reward bot | |
# Before each roll (except the first), do a brute force calculation of risk vs reward. In this case, | |
# risk is the probability of having 3 shotgun dice after the roll, and reward is the probability of | |
# getting an extra 1, 2, or 3 brains. If P(death) - rewardBonus[1]*P(1 brain) - | |
# rewardBonus[2]*P(2 brain) - rewardBonus[3]*P(3 brain) > rvrCutoff, then roll. | |
# If behindBonus and/or aheadPenalty are not zero, then those amounts are added to or subtracted from | |
# the risk vs reward depending on weather the bot is winning or losing, encouraging risky play when | |
# behind and safer play when ahead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="./node-definitions/moment.d.ts" /> | |
/// <reference path="./node-definitions/timezone-js.d.ts" /> | |
import moment = module("moment") | |
import tzjs = module("timezone-js") | |
import fs = module('fs'); | |
export function init() { | |
tzjs.timezone.zoneFileBasePath = './tz'; | |
tzjs.timezone.loadingScheme = tzjs.timezone.loadingSchemes.PRELOAD_ALL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module "timezone-js" { | |
export var timezone : TimezoneJs; | |
export var Date: { | |
new (timezone?: string): TimezoneJsDate; | |
new (time: string, timezone?: string): TimezoneJsDate; | |
new (year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: string, timezone?: string): TimezoneJsDate; | |
}; | |
} |