Teaching the computer to play texas Hold'em poker [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm a beginner in Java and programming but I'm already creating a Texas Hold'em Poker game as a "practice and learn" project.
I know the rules of the game, but I'm not sure how to include bots or computer player that can decide when to go in and when to quit, how much to bet (including All-in bet),and if possible even to bluff from time to time.
At this point my question is:
Should I take an effort to "explain with if's and then's, when to do that or is there an algorithm that allows the bot player to do that?
If it exists, would that algorithm be specific for poker or is possible to reuse it to any game to allow the computer to "learn" the rules described in the programming, for different rules or even different games (so it applies to chess or monopoly, etc)?

The complexity and state space of the Poker is not large. Therefore it is possible to just exhaustively search all the combinations. In fact you can even calculate the probability of getting each cards with some arithmetic. I would recommend you to read Poker Theory and Analytics by Kevin Desmond on MIT Open Courseware to understand more.
Your idea is exactly what decision trees or random forests are. They are machine learning techniques that can build human-understandable rules with a tree of if-s.
On the other hand, there are also non-human-understandable machine learning. Neural network is a kind of that. The models are non-intuitive to human. They are mainly used for the problems that are hard to formulate or with extremely large state space, for example, playing Go (just like AlphaGo), identifying all the objects in an image, or how to win Starcraft.

Related

How to start learning Big Data? What are the modules I need to concentrate on as a developer [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm planning to learn Big Data. I just have gone through tutorials but I'm a little bit confused what the modules are that I need to concentrate on from a developer perspective. Presently I'm working on java. I hope your response will be helpful for the next step of my Big Data journey.
First I'd propose to get familiar with the term, Big Data is a bit fluffy and debated one, more a marketing catchphrase than a technical specification, covering a huge range of technology.
Starting from that I'd try to determine which aspect (IoT, build/run datacenters, etl/data integration/warehousing, analytics/statistics/machine learning...) or perhaps which field of application (retail, bioinformatics...) you're interested in, and which is reasonable to access from an employment point of view. I'd think also about the tech stack you'd like to work on (Scala, Python...).
Reverse engineering job offers could be a way to get to that information actually.
The Data Scientist profile (etl + machine learing + visualization) gained broad acceptance and encompasses certain skill sets, Big Data Analyst and Bid Data Engineer also can be found, arguably with a not so well defined profile.
Nowadays one can get whole MSCs in data science (here's a personal evaluation of it), but perhaps you can get your foot into the door on a less fancy route too. Trainigs may come in varying quality, I found Andy Ngs machine learning and deep learing (big neural networks) MOOCs stunning, and everything coming from the EPFL-Scala side (if you want to go down that road) is technically superior and from the presentation ok (I tried Big Data Analysis with Scala and Spark).

Detect whether there is a way out of a 3D room [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm developing this for Bukkit, but I am open to porting a java-only solution.
Now, I have a character in a room with an opening exposed to the outside for radiation to seep in like this:
(sorry for terrible paint skills) In this picture the algorithm should return false, however if that white bit was covered, it would return true.
I need a way of detecting whether the character is inside a room or not. Please remember that a room can be any size, and does not have to be a cuboid.
The way I'd like it to work is that I'd have an arbitrary position above the roof, and if this maze algorithm would be able to reach this position, I'd know that the character is not completely covered.
EDIT: Actually if the exit was 20+ units away, I wouldn't mind the algorithm timing out.
This is not an answer per se, but it may be a good point to move on from.
The definition for room:
a part or division of a building enclosed by walls, floor, and
ceiling.
The definition for building:
a structure with a roof and walls
The definition of a structure:
a building or other object constructed from several parts
Can you see how poorly defined these are? (The definitions for building and structure are recursive!) Until you can come up with a clear cut, black and white definition for what you consider to be a room, you (and us) have very little hope of coming up with a good solution.

Algorithm that gives hand strength in poker [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am trying to find a way to calculate the strength of a hand, specifically how many unique hands (of the 169 starting hands) have a higher chance of winning at showdown given a complete or incomplete board (holdem).
I've tried to do this a few ways and have been somewhat successful but it takes an obnoxious amount of time for my program to run given that i'm essentially branching out for every possible hand combo, and comparing aggregate results for every scenario to find how many hands are better than hero's. TLDR it's terribly inefficient and it takes an unrealistic amount of time to run.
However there are tools like this one http://www.cardplayer.com/poker-tools/odds-calculator/texas-holdem that seem to do the calculation a lot faster. The above program seems to do calculations for all possible future board combinations, so it can give you the better hand for incomplete boards. Although, for my particular program i'd like to find the number of hands ahead of hero's at any given point, which would require me to run the program above for each of the 52*51 non-unique starting hands, and find my hand's place among the rest and once the number of better hands have been gotten, i'll have to reduce those to unqique starting hands (ie 8c7h and 8h7c would be reduced to 87o)
So my question is, are there any tools/frameworks/references (preferably in Java) out there for calculating the strength of hero's hand vs an anonymous hand given any complete or incomplete board that also doesn't take a day to run?
I am not much of a poker kind of guy, but you may find ThePokerBank site interesting, what about a whole course dedicated at poker theory from MIT, a bonus infographic to help you out too.
There are different strategies that you can take to try to tackle this issue, all of them involving quite some knowledge on Statiscal analysis, I would say that one of the reason other poker algorithm work a bit better is that they are using a form of vectorization math instead of a series of for loop. I know that language like octave/MatLab/R take this strategy to do bulk operation.
Good luck and have fun!!
This thread has much information Stack Overflow Evaluation Algorithms
Also at Code Project and a tutorial on an algorithm and Java source: at Github and in different languages at rosettacode.

Implementing Betting for a Poker Game [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am currently writing a Texas Hold'Em style Poker game that I would like both humans and computers alike to be able to play. However, I am hung up on how to implement the betting rounds. Currently I have a PokerGame class which consists of the community cards, the size of the pot, a List of PokerPlayers and a few other things. How would I implement a method that "asks" each player (I can't take input because it might just be a computer) whether they want to call, raise, etc? Originally I though I might just implement a server or possibly multithreading, but that seems way to complex. Currently my only though is setting up some sort of input stream between the game and each player in the game.
Write subclasses HumanPokerPlayer and ComputerPokerPlayer. Have PokerPlayer provide an abstract method placeBet() and override it appropriately for the human and the computer class.

jumping form Java to C [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Ok I gave been playing around with java for a year now an I can say that is is in my power to write a fully functional program.
A month ago I started studying vectors and so, when I tempted to implementing them into the LWJGL I realized that Java is not fast enough for the level of graphics that I wish to generate.
Now that is my problem and I have decided that I must learn a stronger Language but where do I begin I have tinkered around in C/C++ before but it kills my ambition to go and start over after already using a hole year.
my "algors" for rendering a vector are:
z = r(cos t+j sin t) //where the t is degrees and r is its length
(for the curious)
the program the continues a loop that alters its length with 1, gets its end X and Y and draws a pixel on that spot.
Not for game coding.
Name 1 free E-Book that will get Me on My feet with C
I realized that Java is not fast enough for the level of graphics that I wish to generate.
Java is plenty fast. Unless you want to work with high performance graphics, you can use it safely (and you will probably be able to use it even with high performance graphics).
In the vast majority of cases, the speed of your application will be a function of algorithmic complexity, not language used.
After your application is completed, if it doesn't run fast enough, you can optimize. If it still doesn't run fast enough, you can implement critical parts in C/C++/your-language-here.
If you start from "the language is not fast enough", you're already doing it wrong.
If you want to write a game, use an engine. There are many great engines in many languages. If you wonder about language-inherent performance, and you try to solve technological issues yourself, you are gonna be stuck doing that forever.
Do not reinvent the wheel. Stop worrying about which programming language is the best fit, and rather think about which engine is best suited for what you want to make.

Categories