This is a submission for Weekend Challenge: Passion Edition
What I Built
Hi! My name is Dave and my background is webmaster/front-end web developer. I have long been curious about creating desktop apps, and I figured this was the perfect opportunity to build one. I also am a novice player of contract bridge, also known as just "bridge", so I figured I would make a bridge app since I am passionate about it.
In bridge, many people like to do a double dummy simulation where all 52 cards are visible between the four positions (North, South, East, and West). This allows them to see how many tricks are possible with a given contract and deal. This allows them to improve their declarer (offensive) play as well as their defensive play and improves analytical decision-making. It also allows them to perform an effective post-mortem analysis (i.e., what went wrong).
Since this is a weekend challenge, I didn't get the chance to add some more functionality like I wanted. In addition to improving the UI, I'd also like to actually be able to play through different hands and add a scoring mechanism that you see on bridge score calculators online. I think combining that with a way to play full hands would be where I would want to go from here.
Demo
Code
DaveH1981
/
double-dummy-bridge-calculator
An app for contract bridge players that uses the double dummy method to find the best card play sequence.
double-dummy-bridge-calculator
An app for contract bridge players that uses the double dummy method to find the best card play sequence. Front end, C++ wrappers, and engine callers are mine. This app connects to the DDS bridge solver written by Bo Haglund, Soren Hein, and Martin Nygren. They reserve all rights as per the Apache 2.0 license.
How I Built It
My background is mostly front end, so that was pretty straightforward for me. The most difficult part was figuring out how to link to the DDS double dummy bridge engine. I went with Electron and GYP as a wrapper, linking the HTML/CSS/JavaScript frontend with the Node.js runtime environment as well as the C++ code on the backend. The backend also calls from the DDS bridge solver written by Bo Haglund and updated by Soren Hein and Martin Nygren. I made sure to credit them on my GitHub repo along with posting a copy of the Apache 2.0 License.
At first, I tried downloading the necessary files from the DDS GitHub repo, but that was very time-consuming due to the amount of dependencies and header files needed to make them work. Google was helpful in determining the best way was to just download the .dll and .lib files from the source and put them in my project folder. Along with the binding.gyp, adddon.cpp, and dds_clean.h files, that was enough to tie it all together and make the app work.
I didn't really use AI coding agents except for the version of Gemini that comes with the Google search engine. Gemini was helpful with debugging the C++ wrappers that helped connect the front end to the DDS engine, but I had to ensure that I prompted it correctly. My knowledge of C++ is limited compared to HTML, CSS, JavaScript, and PHP, so I had to read the console error messages carefully to know what to look for. The biggest problem I had was when I would make changes to the code and then there would be errors thrown by Node trying to interact with the C++ compiler.
While this submission was certainly a challenge, I enjoyed seeing a desktop app come to life in a matter of hours, even though it is very basic and has plenty of room for improvement. It pushed me out of my frontend comfort zone, although I got to have plenty of fun doing that as well. Thanks for reading.
Top comments (0)