I can’t get the AI to work correctly in this project. For some reason it won’t play the right cards. Does anyone know why?
oh that happens to me to
that is amazing dude!!! so good
Nice job, is there any way u could sow me the AI code? For example put maybe a brain emoji or something so it’s easier to understand
I mean too
Not really good with AI, but I’ll take a look.
Yeah, AI is something I’ve played around with in hopscotch quite a bit
Could you tell me what each variable means?
Sure! Any variable where it says “PC_N” (_ is a number 1-7) is the number of one of the player’s cards. It’s the same thing for the colors, but instead it’s “PC_C”. CCC is the current card color, and CCN is the current card number. Turn is who’s turn it is. When turn = 2, it’s AI’s turn, and when turn = 1, it’s your turn. C_N is for the computers numbers. C_C is for the computers colors. Thinking is to make it appear as if the AI is thinking. Did that make sense? @Shadow_Spider
That’s good, thanks!
One more thing: could you elaborate on what the AI is doing wrong?
So it’s only supposed to set the current card to one of it’s cards if it has one that would work. However, it’s occasionally just setting the current card to a card of a completely different color and number. Once it uses a card, it sets that cards values to -1. For some reason, though, it’s setting the current card to -1 sometimes.
I’ll take a look.
Everything looks good so far - I might use Awesome_E’s debugger for this.
One question - what does it mean when CCN = 11 or 12?
When CCN = 10, the card is a reverse
When CCN = 11, the card is a skip
When CCN = 12, the card is a +2
When CCN = 13, the card is a wild
When CCN = 14, the card is a wild +4
How do you simulate getting +2/+4 cards? Or is that not added yet?
This would help @Spider
I would love to debug this!