Skip to content

Instantly share code, notes, and snippets.

@waprin
waprin / analyze.py
Created August 13, 2018 16:32
analyze opponents
print('------------Opponents---------------------')
hero_wins = collections.defaultdict(int)
hero_totals = collections.defaultdict(int)
hero_matches = collections.defaultdict(list)
for match in wisp_matches:
for hero in match.opponent_picks:
hero_totals[hero] += 1
if not match.liquid_win:
hero_wins[hero] += 1
hero_matches[hero].append(match.match)
Processed 387 Errors 11
Liquid won 258 of the games.
Found 47 out of 387 games where Liquid picked Io.
Io was banned in {} matches. 239
Wisp lost in 13 of the games.
------------Opponents---------------------
Hero Tiny has won 3 out of 3 games against Liquid IO for a win percent of 1.0 (matches [3796359654, 3796268587, 3766915400])
Hero Razor has won 1 out of 1 games against Liquid IO for a win percent of 1.0 (matches [3698342712])
Hero Brewmaster has won 1 out of 1 games against Liquid IO for a win percent of 1.0 (matches [3595326728])
Hero Leshrac has won 1 out of 1 games against Liquid IO for a win percent of 1.0 (matches [3595326728])
@waprin
waprin / gist:a5eae8a90c1847c6bdfad914a934e286
Created March 1, 2024 18:43
hacky live poker "spaced rep"
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]]; // swap elements
}
}
function getRandomQuestions(questions, num=20) {