Mastermind (tm) - Pool reduction and Minimax algorithms

Use this section to discuss your embedded Flowcode projects.
mnfisher
Valued Contributor
Posts: 1961
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 158 times
Been thanked: 926 times

Re: Mastermind (tm) - Pool reduction and Minimax algorithms

Post by mnfisher »

Oh - and Dungeon Master.....

Happy Days!

chipfryer27
Valued Contributor
Posts: 1974
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 433 times
Been thanked: 647 times

Re: Mastermind (tm) - Pool reduction and Minimax algorithms

Post by chipfryer27 »

Pyramid for the TRS-80 ??

I really cannot be bothered with modern games / consoles at all. Do zero for me as I think life is too short to bother with this rubbish :)

Huge industry though. Maybe if I had no job or interests I would favour more? Much rather figure out how to get hedgehogs into my garden than have them bounce off a cloud to catch a floating gold ring or the like.

Regards

mnfisher
Valued Contributor
Posts: 1961
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 158 times
Been thanked: 926 times

Re: Mastermind (tm) - Pool reduction and Minimax algorithms

Post by mnfisher »

Yes. Dungeon Master was 1988 and probably the last game i played a great deal. It was more exciting times in computing though - the Amiga (and Atari ST) coming in the last years of the real fun (starting with the ZX spectrum (or Zx80/81 though a bit more frustrating))

Just found a copy of HiSoft Pascal - wonder if I can get it running on a Pi emulator? Not sure i even have a tape deck now?

chipfryer27
Valued Contributor
Posts: 1974
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 433 times
Been thanked: 647 times

Re: Mastermind (tm) - Pool reduction and Minimax algorithms

Post by chipfryer27 »

Hi Marin

I definitely have tape decks. Still listen to my C90's (remember C30, C60, C90 go!).

If you have tapes I could convert to mp3 for you.

I tried for ages to find tapes of TRS-80 programs, but never found anything. I would even have bought second hand as I am sure with DSP even really terrible recordings could be regenerated. That would be a really excellent project for a Flowcode SysBlock. It would be a breeze for it methinks.

Regards

mnfisher
Valued Contributor
Posts: 1961
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 158 times
Been thanked: 926 times

Re: Mastermind (tm) - Pool reduction and Minimax algorithms

Post by mnfisher »

Thanks for the offer - might need it when you are the right way up again :-)

So far tried the 'baremetal' emulator on a Pi3 - with no joy (no anything at all :-( ) When I have a few minutes will try the 'fuse' emulator...

Martin

mnfisher
Valued Contributor
Posts: 1961
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 158 times
Been thanked: 926 times

Re: Mastermind (tm) - Pool reduction and Minimax algorithms

Post by mnfisher »

I pulled the bit array to a new component - which I called bool_array. I think BitArray would probably be a better name - but for now it remains.

I made it a bit more Flowcode - it simulates (though it would be a lot of single stepping!) - and it doesn't return a 'pointer' - it just uses an internal one for the bitmap - this means that each instance of the component can only handle a single bool array - but means that the user doesn't need to pass a handle (or size). Probably a 'really' Flowcode version would have a size as a property - and create the array at compile time rather than runtime.

I changed from a 32 long word division of data - to a byte - which should be quicker on 8 bit MCUs - and the esp32 has horsepower to spare - there could be a choice, either user or depending on MCU?

So - a bool array... If I do bool x[1024] - then I have a bool array BUT it uses 1024 bytes (1 byte per value) - here we use 1 bit per value (so 129 bytes in this case - I cheat on rounding)

Then I removed the bit handling code from 'mastermind' and replaced with this component. Fortunately it still works :-)

A question:

To get around the name 'mangling' - I use (for example) .map = map to copy the global to a local and then use FCL_MAP. Is there a better way?

Martin
Attachments
bool_array.fcpx
(2.21 KiB) Downloaded 3 times
bool_array.fcfx
(19.2 KiB) Downloaded 3 times
mastermind.fcfx
(36.4 KiB) Downloaded 3 times

Post Reply