filmov
tv
Coding a game in Python | Check for identical values in a COLUMN

Показать описание
Checking for identical values in a 'column' in a 1d array game board representation.
Even if you are not interested in games, or Python, as a coder this logic is still useful.
Checking for 3 in a ROW is easy, but in a COLUMN requires slightly more thought...
- chapters -
00:00 intro - board game ideas - gomoku
05:00 prepare heuristics for minimax
13:10 check the columns with nested for loops
17:15 checking the rows in vscode
22:47 get the board positions / edit the code to print indices
26:15 change the board size constant to add more rows
I'll read this article in due course as I try and better understand heuristics :
Feel free to skip ahead and read it / advise me on my code / suggest improvements / other articles!
👍 Become a patron 👍
Buy Dr Pi a coffee (or Tea)
🔥 Proxies 🔥
=================================================
If you need a good, easy to use proxy, I was recommended this one, and having used ScraperAPI for a while I can vouch for them. If you were going to sign up anyway, then maybe you would be kind enough to use the link and the coupon code below?
You can also do a full working trial first as well, (unlike some other companies). The trial doesn't ask for any payment details either so all good! 👍
◼️ Coupon Code: DRPI10
(You can also get started with 1000 free API calls. No credit card required.)
Thumbs up yeah? (cos Algos..)
#forloop #tutorials #pythontutorial
Even if you are not interested in games, or Python, as a coder this logic is still useful.
Checking for 3 in a ROW is easy, but in a COLUMN requires slightly more thought...
- chapters -
00:00 intro - board game ideas - gomoku
05:00 prepare heuristics for minimax
13:10 check the columns with nested for loops
17:15 checking the rows in vscode
22:47 get the board positions / edit the code to print indices
26:15 change the board size constant to add more rows
I'll read this article in due course as I try and better understand heuristics :
Feel free to skip ahead and read it / advise me on my code / suggest improvements / other articles!
👍 Become a patron 👍
Buy Dr Pi a coffee (or Tea)
🔥 Proxies 🔥
=================================================
If you need a good, easy to use proxy, I was recommended this one, and having used ScraperAPI for a while I can vouch for them. If you were going to sign up anyway, then maybe you would be kind enough to use the link and the coupon code below?
You can also do a full working trial first as well, (unlike some other companies). The trial doesn't ask for any payment details either so all good! 👍
◼️ Coupon Code: DRPI10
(You can also get started with 1000 free API calls. No credit card required.)
Thumbs up yeah? (cos Algos..)
#forloop #tutorials #pythontutorial