Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:57 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: Game: BoxDot - Connect dots, make squares, triumph!

Author Message
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 06:32am 30 Oct 2020
Copy link to clipboard 
Print this post

Here is a little diversion, good for testing your shiny new CMM2 mouse. (No mouse, no play)

A CMM2 version of the classic pencil and paper game Dots & Boxes. Adjust the mouse I2C port in line 18 to suit your setup. Mine uses the Nunchuk port on the front so it's set to 3. Yours will likely be different.

Program ENDs on lines 35 and 157, in case someone needs to know...



At this point, the computer AI is anything but. It will ruthlessly take every opportunity given it to capture squares, and it will never give away squares if it has a choice, but when it must give away a square, its choices can be extremely poor.

Maybe in the future, it will be made smarter...
Visit Vegipete's *Mite Library for cool programs.
 
Sasquatch

Guru

Joined: 08/05/2020
Location: United States
Posts: 377
Posted: 08:56pm 30 Oct 2020
Copy link to clipboard 
Print this post

Another excellent puzzle game by VegiPete!  

I can confirm that it works well with both the HobbyTronics-USB Mouse module as well as the Arduino-PS2 Mouse interface.

I haven't had much time to play lately but so far it seems great!
Edited 2020-10-31 06:57 by Sasquatch
-Carl
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 07:46pm 01 Nov 2020
Copy link to clipboard 
Print this post

Here is an update that makes the computer much smarter. You can choose "Easy" which plays the same as before, and "Hard" which checks all moves before giving away squares. Note that there is no indication when the computer is thinking - you just have to wait for it. A big think can take almost 15 seconds.

boxdot04.zip
Visit Vegipete's *Mite Library for cool programs.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025