Golf is a multiplayer card game in which every player competes to finish with the lowest score. Golf.py is a python command-line game where the user battles the computer in a game of virtual Golf! May the best golfer win!
David Oloketuyi
Check their project out: Gameboy emu
Oliver
Check their projects out: Python Ethical Hacking Toolkit, CourseNotes, Gradient Club, Branch YSWS, opott.uk
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
Completely remade the bot. It now simulates every possible move, and decides what to do based on the moves that reduce the bot's score the most.
I improved on the way a position in the user's hand is inputted. Previously, the user was prompted to enter the row and column of the card separately. I found this to be unintuitive, and too easy to make mistakes. I have now opted for a 'spreadsheet' style input where the rows and cols are defined as letters and numbers (e.g., A1 = 0, 0). This is easier to use. I also made it so that the game ends when a player has all of their cards face-up, and the winner is calculated.
Improved the bot now, it is pretty good at the game. At the moment, it doesn't take into consideration the player's hand, so it doesn't play the best possible move every time.
I got the bot working. Its in its early stages, so its pretty dumb. I will try to improve on it.
Ok.... I added some comments to the code, and tidied it up a little. I also made it periodically clear the terminal, so that it doesn't get too cluttered and still looks nice. Also more colour because colour is fun!
Started on the game loop, added some terminal colours using ASCII sequences. The decks and hands are randomised when the program is run. Added lots of input validation to make sure there are no errors :)
Created class for a player's hand. The cards stored in a 2D array since there must be two lines. I also added some basic code to print out the player's cards next to the computer's cards as tables, using the tabulate module.
Created the base classes for the game: Pile and Card. The Pile class contains an array called cards, which holds all of the cards in the pile. It can be initialised to contain a whole deck, and can be shuffled. The Card class can be used to get the score of a card, or to get the name of the card as a string