GithubHelp home page GithubHelp logo

Comments (11)

NikolayIT avatar NikolayIT commented on June 6, 2024

Will be fixed. Thanks! Create pull request next time.

from texasholdemgameengine.

kiko81 avatar kiko81 commented on June 6, 2024

this way not the highest possible straight is returned but the lowest instead - will fix it

from texasholdemgameengine.

NikolayIT avatar NikolayIT commented on June 6, 2024

Add unit tests (for regression)

from texasholdemgameengine.

kiko81 avatar kiko81 commented on June 6, 2024

!!! line 134 - var straightCards = cards.Select(x => (int)x.Type).ToList(); - returns duplicates

renaming proposal: CompareTwoHandsWithHighCard => CompareKickers/CompareSideCards

Comparing straights - comparing any card[1-3] is enough - no Ace possible there -
bigger wins - no matter which way sorted - think will be faster O(1)

from texasholdemgameengine.

NikolayIT avatar NikolayIT commented on June 6, 2024

Open new issues for every single bug.

from texasholdemgameengine.

NikolayIT avatar NikolayIT commented on June 6, 2024

When comparing straights there are objects of type CardType so Ace is expected.

from texasholdemgameengine.

kiko81 avatar kiko81 commented on June 6, 2024

Mean if compare e.g. 2nd cards only - no Ace possible there - Ace may be first or last only

from texasholdemgameengine.

NikolayIT avatar NikolayIT commented on June 6, 2024

What about this case:

new[]
    {
        CardType.Six, CardType.Five,
        CardType.Four, CardType.Three,
        CardType.Two
    },
new[]
    {
        CardType.Five, CardType.Four,
        CardType.Three, CardType.Two,
        CardType.Ace
    }

from texasholdemgameengine.

kiko81 avatar kiko81 commented on June 6, 2024

e.g.
2nd cards: five > four => first wins
3rd cards: four > three => first wins
4th cards.......
Aces can be in the beginning or the end of hand - not in the middle - don't check ends - any middle card will do the trick
Not wrong now, of course, but may be less complex

from texasholdemgameengine.

NikolayIT avatar NikolayIT commented on June 6, 2024

I've got the idea but the current solution is O(n) and the one you suggest requires sorting which will be O(n * log(n).

from texasholdemgameengine.

kiko81 avatar kiko81 commented on June 6, 2024

thought they come sorted from hand evaluator, from tests come shuffled - anyway U know better 👍

from texasholdemgameengine.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.