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.