To continue from where I was last week, I continued to work on my search algorithm and add to the bid where needed. First, the algorithm counted the trump in the hand and added it to the bid. Second, it would count the number of cards in each suit. From there it would load the cards into arrays based on their suit. Last, the algorithm would evaluate the cards to decide if they were worth bidding on or not.

Counting the trump in each hand is rather simple. Search the hand for trump and add one to the bid for each trump card found.

Evaluating the off suits was a different story. I could search through the hand and evaluate each card’s suit, but for some reason, I was not able to use the javascript .push() method to push the card rank into the arrays I had built for each suit. At first, I thought I might be looping through the cards incorrectly, but after some debugging found that it was the .push() method itself that would not push the card ranks. I tried a few other javascript methods similar to the .push() method, but none of those worked either. For the sake of time I had to create array for each suit that had a length of 13. This made my arrays have null values. To avoid the null values, I used the javascript .sort() method to sort the array’s going highest rank to lowest rank.

Once I finally had my arrays loaded for each suit I evaluated the cards by the logic of:

If the card being evaluated had a rank that was great than the highest ranking card in that suit minus the number of cards of that suit that are in the hand being evaluated, add one to the bid.

Because I was only building the bidding process for the game, and may I say a very basic bidding process, I knew all the cards except for two were out and in a players hand making this evaluation very likely to be correct.

In The Future

In the future, I’d like to finish the game altogether. The most challenging parts I see moving forward are making the bidding process¬†even more accurate than it already is and giving each player a strategy for playing the game in its own way.

The bidding process is so complicated that I’m not even sure how to build more components to it. For instance, if my partner bids 6, then the next player bids 6 I don’t want to bid 6 because I have to think about the fact that I could take some of the cards my partner had bid on. I can’t just pick any number to take off of my bid because it depends on how my partner bid their hand, the number of cards in each players hand, the trump suit, and the strategy with which that player plays. This is something that I will have to brainstorm a little more to be able to build.

Implementing strategies to each player individually will be a challenge in itself as well. I haven’t done a lot of thinking about this process, but I know it will take some brainstorming as well.

Overall Thoughts

My overall thoughts on the project for class are that I didn’t realize how complex and difficult this process would be. My instructor asked if maybe I could throw some randoms into the process somewhere. That might be a good idea as my boyfriend said that bidding your hand correctly in this game is almost luck. Bidding your hand depends upon how the players you are playing with play.

I feel as if I did get the bidding process done for the class project. I feel I did well for the amount of time I had to put into the project at the end of the semester. I would like to finish the game in my own spare time.