diff --git a/players/challengerBot.js b/players/challengerBot.js index 74b45d4..a25bdcf 100644 --- a/players/challengerBot.js +++ b/players/challengerBot.js @@ -1,17 +1,92 @@ module.exports = function () { var info = { - name: "Nameless Challenger", - email: "", - btcWallet: "" + name: "evBot", + email: "evbot@noman.land", + btcWallet: "nil" }; - + + // Haxx - get submodule on old node + // I hope these don't count as "external modules" + // as they come with the game engine + var mp = require.cache[require.resolve('machine-poker')] + var hoyle = mp.require('hoyle') + var Hand = hoyle.Hand; + var deck = new (hoyle.Deck)().cards; + + // increadably bad card dealer + function randCard(used) { + while(true) { + var card = deck[Math.floor(Math.random()*deck.length)].toString(); + if(used.indexOf(card) == -1) + { + used.push(card); + return card; + } + } + } + + // slowest game simulator on the planet + // needs serious optimizations + function simulate(hand, community, opponents, iterations) { + var wins = 0; + var games = 0; + var used = hand.concat(community); + + for(games=0; games