quote:
However, the algorithms were the easy part and my computer 42 AI was pretty good.
playing who, you?
to make any 42 AI worth their weight in code, you have to introduce a controlled randomness in their playing.
The first 42 app for the iPhone was complete crap... the second is a little better, but the AI is lacking.
No, the AI algorithms are the impossible part of coding 42 for a single player. Getting the play functions down is quite simple, you just have to make your own algorithm for the rules of bidding and play.
I attempted to take this on about two years ago, except I found that implementing an app is neither easy, nor cheap... so I stuck with c++, and stalled where I started to need to create graphics for the dominoes, but the game works in text.
The biggest problem with coding the AI is that there is no set algorithm for play, it depends on who bids what, when, and what the score is... then what trumps are, what is lead, and what you are looking at in your hand.
If you code all of the AI to think alike, the game becomes predictable... which is boring. If you code the AI to make absolutely random plays, the game is just stupid and no fun to play.
For a good starting point, first, you have to look at the bid, the trumps, and what has been played, then identify, while looking at least three tricks ahead, what the best play is... If you think making a chess engine is difficult, keep in mind, you get to see both sides of the game... there is always a "perfect" play on a chess board. While in 42, there is always a "best" play, but determining that for a fact involves making decisions about dominoes you can't see and have to make a guess on... at a table it's not so difficult... programming it, impossible.