Gamer Games for Lite Gamers

🎡 The song for this post is γ‚€γ‚€γƒŠγƒ…γ‚±γƒ–γƒ«γƒΌ, by Charisma.com. 🎡

Hillel wrote a post I really like for April Cools, on "gamer games for non-gamers":


This is a companion discussion topic for the original entry at https://morepablo.com/2025/04/gamer-games-for-lite-gamers.html

It took me 12+ hours to write my original article and you wrote an equivalent followup in one afternoon. Crazy.

Anyway your Layton solution inspired me to try it too. Here’s what I came up with:

% Constraint Logic Programming
:- use_module(library(dif)).	% Sound inequality
:- use_module(library(clpfd)).	% Finite domain constraints


score([], [], 0).
score([A|As], [K|Ks], N) :-
    (A = K,   N #= M + 1 ;
     dif(A, K), N #= M),
   score(As, Ks, M).

keytype([]).
keytype([K|Ks]) :- member(K, [a, b]), keytype(Ks).

key(Key) :-
    length(Key, 10),
    keytype(Key),
    score([b, b, a, b, a, b, b, a, b, b], Key, 7),
    score([b, a, a, a, b, a, b, a, a, a], Key, 5),
    score([b, a, a, a, b, b, b, a, b, a], Key, 3).

key(Key), score([b, b, a, a, a, b, b, a, a, a], Key, X).

The keytype predicate bothers me, I wish I knew how to properly typecheck a list.

Anyway your Layton solution inspired me to try it too. Here’s what I came up with:

This rocks!! I wrote my solution way back in undergrad, I have to take a look at dif and clpfd (and play with logic programming more, generally :stuck_out_tongue: ).

It took me 12+ hours to write my original article and you wrote an equivalent followup in one afternoon.

Well, it’s easier to riff on a theme when someone else did a lot of hard work to riff on :sweat_smile: The content was top-of-mind because I’ve been hosting my niblings a lot.