A Simple GUI for an incredibly strong checkers engine

This may sound strange or even funny to some of the readership here, but I already have a really strong checkers engine as a 64-bit console app built with Visual Studio 2015. I used C and not C++.

I also have some amazing graphics.

The checkers and Kings were rendered on high-end graphics workstations. The board is faux-marble and very appealing as well. All are saved as .png files.

Because they are such high resolution, and quite large in rectangular dimension, the graphics API call I need to make to render the disposition of the pieces on the board will need to scale the images down.

Hopefully, Windows 10 has calls that can deal with this.

I would need to draw the empty board offscreen somewhere, draw the pieces into each relative circumscribed rectangle where they belong, then execute something like the old BitBlit() thingee.

I am completely Windows-Event-Unaware: I have no idea how to detect or process mouse clicks or render menus or any of that good stuff.

At present, my program can forecast a win from up to 291 moves away (counting moves for both sides) using large Distance-To-Win databases probed in RAM on a machine with 128 GB.

I would love to put the finishing touch on the program, but I do not know where to begin.

Every serious recommendation will be greatly appreciated.
Hi Thomas,

And thank you.

I knew it wasn't easy the first time I glanced at all of those foreign data types that were filled in as parameters to function calls I never heard of. Back in 1984 I had Inside Macintosh as a great reference volume for all of my Macintosh programming needs.

I have been on a quest for the functional equivalent in the PC world, and was functionally stymied.

I will go through your references very thoroughly, starting with the .net material.

Thanks again!

I am completely Windows-Event-Unaware: I have no idea how to detect or process mouse clicks or render menus or any of that good stuff.


That's amazing what you've accomplished. There is a whole Windows subsystem for dealing with console mode apps, if that is what you want to maintain your work in. I guess one would call it the Console Api. If you are interested I can post some small apps (less than 100 lines) that make the Api Function calls to process mouse input etc. By looking up the Api calls it could get you started.

Added later.

On 2nd thought though, are you really wanting to get away from console mode? Console mode seems to me like a poor way of doing anything with a lot of graphics, which I gather your code has. How did you even manage that, given that you claim you have no knowledge of Windows related graphics programming?

I've posted tutorial material here...

http://www.jose.it-berater.org/smfforum/index.php?topic=3389.0

..which will quickly take you into the world of GUI interfaces, mouse handling, and menus using the Windows API.
Last edited on
Hello Freddie,

And thank you for the compliment and especially the instructional links. It's time for me to start becoming less of a programming dinosaur, so any basics to get me into the GUI environment will be very welcomed. I shall enroll myself back in school, and assign myself your homework.

:)

Much appreciated.
I don't know if punch cards will ever rule again, but it is how I started out back in Computer Science 101 at Penn State in 1975. The Computer Science Lab was on the 2nd floor of the Hammond Building, and the nature of the hardware was such that it preferred a temperature and humidity higher than most of us humans preferred. I took the course in the winter, so one would walk out of an 80 degree room into zero degree weather with about a 20 mph wind. Not good.

I welcomed the avent of personal computers and the demise of punched cards for writing programs, I'd have to say! :)
Those punched cards were a great challenge when learning programming. You'd write a program on coding sheets, get them typed up onto punched cards, and despatch the cards to be submitted to the machine. About three days later you'd get the set of punch cards back with a print-out stating where the compiler errors were. It placed the emphasis differently to nowadays, every line, every single character would be scrutinised and considered before daring to resubmit the job.
...and....in case anyone didn't pick up on it....

My screen name is totally sarcastic :)

Those punched cards were a great challenge when learning programming. You'd write a program on coding sheets, get them typed up onto punched cards, and despatch the cards to be submitted to the machine. About three days later you'd get the set of punch cards back with a print-out stating where the compiler errors were. It placed the emphasis differently to nowadays, every line, every single character would be scrutinised and considered before daring to resubmit the job.


Exactly Chervil! What most of my classmates did was spend their entire Saturdays at the Computer Science lab continually typing out cards and re-submitting them. The setup was such one could get output maybe after a five or ten minute wait at the card feeder. I preferred to agonize over every code line back in my apartment trying to visualize the looping and values of the iterators. I'd work it out so I could get my program to run after only one or two tries at the lab. I probably spent as much time at it as the other folks, but at least I did most of it from the relative comfort of my apartment!
Topic archived. No new replies allowed.