15 years ago, on January 9, 2011, I published my f...
# feed
s
15 years ago, on January 9, 2011, I published my first-ever Android app. I built this little Dots and Boxes game over a weekend, mainly to learn how Android development worked and how to get an app onto Google Play. My wife made all the cute graphics for it back then. ☺️ I pretty much abandoned it afterwards. Over the years, I only touched it when Google threatened to remove it because of an outdated target SDK. 😅 And until now, it was still using the old Android View system I built it with back in 2011. Today, I finally gave it some love again. With DeepSeek V4 Flash helping out, I spent less than half a day turning the old Android app into a proper Compose Multiplatform version. 15 years later, my very first Android project is still alive. And now it can live a little longer. 😄 Source (GPL3): github.com/StefanOltmann/dots-and-boxes Android: play.google.com/store/apps/details?… Web: stefan-oltmann.de/dots-and-boxes P.S.: I absolutely love how a CMP port gives you a Desktop & web version for free. ❤️
👍 14
❤️ 2
s
I've never seen this game before, and I had a nice time picking up the basic strategy how did you implement the computer opponent? did you do some minimax search or some heuristics?
s
Really simple. 😄 If it first checks the board to see whether it can close one of the free lines and score a point. If not, it randomly selects a line and checks whether doing so would give the opponent a chance to close a box. If it would, it tries again. It does this up to 30 times. If it cannot find a suitable line after 30 attempts, it simply selects a random line. That's the algorithm I used 15 years ago, but I'm sure Opus could figure out something way smarter. 😄 github.com/StefanOltmann/dots-and-boxes/blob/…/GameLogic.kt#… github.com/StefanOltmann/dots-and-boxes/blob/…/Board.kt#…
s
I just vibe coded a version with a minimax opponent and I'm having a hard time beating it
😄 1
s
I accept PRs. 😄
But I'm not sure if people love a game where they're constantly failing. ^^
s
I only started learning this game today, maybe you'll fare better than me against this opponent: code.sargunv.dev/dots-and-boxes
👍 1