03-09-2021 12:17 PM
Try to beat this. Pretty impressive minimalistic code.
I wonder how easy it would be to translate to LabVIEW. 😄
(... and yes, I beat it on the first try ;))
03-10-2021 01:18 AM
03-10-2021 02:21 AM
@altenbach wrote:
(... and yes, I beat it on the first try ;))
Do you mean you made a VI that does the same, and it's smaller than 1 kB?
An empty VI is 4kB...
03-10-2021 02:25 AM
wiebe@CARYA wrote:
@altenbach wrote:
(... and yes, I beat it on the first try ;))
Do you mean you made a VI that does the same, and it's smaller than 1 kB?
An empty VI is 4kB...
Do you question Altenbach? Of course he did! 😀
Ok, maybe not, but a fair comparison would be to only compare the same piece of code.
03-10-2021 08:23 AM
The whole application isn't 1kb, just the "game engine" the UI appears to be something extra. So in that case I'd argue that the block diagram and front panel shouldn't be included, and just the code. Still impressive, and I don't intend on submitting any LabVIEW equivalent.
Also about 10 moves in I remembered I'm not as good at chess as I once playing kids my own age, it was probably going to beat me.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-10-2021 11:01 AM - edited 03-11-2021 11:08 AM
Yes, I did not mean to match the code size, but just to implement the same algorithm in LabVIEW. (Unfortunately, I don't understand the code 😞 )
Chess programming has a long history and back in the early eighties there were commercial chess computers that ran on tiny microcontrollers. (e.g. on a 400kHz Hitachi 4 bit processor with 2k of ROM (10bit words) and 80 Bytes (0.08kB!) of RAM. details).
The main strength of this program is the unpredictability of its moves (jungle chess strategy) and since it thinks a small fixed number of moves ahead, to win 100%, simply do not make any glaring mistakes or it will immediately pounce. 😮 (It plays very aggressively and typically leaves its pawn structure in shambles. I haven't lost yet except when I played to lose to test things. Make sure to mentally keep track of the position because the pieces are (maybe intentionally) difficult to tell apart, especially if parts of the black pieces overlap. 😉 )
Maybe somebody wants to play it against our friend here. 😄
03-10-2021 07:11 PM
Glaring errors like moving the R 1st when castling, inadvertent touches, or missing which black piece moved when blinking. Not the best UX.
Back in the day, I trimmed Othello down <6k in Basic including display and score. Like Checkers and connect 4, Othello is not a game. When there exists a solution, it becomes a puzzle. I suspect "Go" is also a puzzle, but the permutations are excessive.
03-11-2021 10:42 AM
@JÞB wrote:
When there exists a solution, it becomes a puzzle. I suspect "Go" is also a puzzle, but the permutations are excessive.
By that definition, Chess is also a puzzle and it has been fully solved for 7 pieces or less. The chess tablebase for 7 pieces nicely fits into 140TB. You can extrapolate that it will take an infinite time and resource to solve the full game, even for 8 pieces it is getting very difficult. (see also).
Note that I did a similar thing in my LabVIEW 4x4 tic-tac-toe game. It simply contains a database of all possible decisive positions, making it nice and small (Few MB) because I eliminated all transformations (rotation, mirror, etc.) and all positions that are a draw or impossible to reach. It was a lot of fun to efficiently generate that database. It might be worth revisiting that topic now that we have maps, but I think my algorithms back then were quite efficient and would still be hard to beat.
Go has a significantly steeper combinatorial explosion and is thus much harder than chess using classic search algorithms. Moderns AI methods seem to work well, though. The success of e.g. AlphaZero (and previous iterations of it) against top humans, just proves the limitations of the human brain. You don't really need to be very smart (on a cosmic scale!) to be the world champion, you simply need to be smarter than the second best human. 😄
In chess, top computer programs are now significantly better than any humans. Top humans can still win occasionally with sufficient handicap (e.g. knight odds).
03-11-2021 11:08 AM
@altenbach wrote:
@JÞB wrote:
When there exists a solution, it becomes a puzzle. I suspect "Go" is also a puzzle, but the permutations are excessive.
By that definition, Chess is also a puzzle and it has been fully solved for 7 pieces or less. The chess tablebase for 7 pieces nicely fits into 140TB. You can extrapolate that it will take an infinite time and resource to solve the full game, even for 8 pieces it is getting very difficult. (see also).
The likelyhood of a solution does not infer that one has been calculated into existence. Although the time and resources available today are not sufficient to produce a solution, I would not extrapolate that those requirements are not finite. So, Chess is still a game! Masters of the game persue solutions to specific states of the solution matrices.
03-11-2021 01:35 PM
@JÞB wrote:
Although the time and resources available today are not sufficient to produce a solution, I would not extrapolate that those requirements are not finite.
Once the number of possible states approaches the number of atoms in our solar system, storage alone might be a slight problem. 😄