Going to tell the Preface story tomorrow at work, I guess if your reading this you now know my HN handle ;) Not sure I will do the 'game' but that into was worth clicking the link.
Just for curiosity I just asked chat deepseek to load and solve the game and it solved it in half a second.
It suggested adding some riddle, for example:
path(castle, up, tower) :-
at(blueprint, holding),
(solved_riddle -> true ;
write('Answer the riddle first: What walks on four legs in the morning...?'), nl,
read(Answer),
(Answer = 'human' -> assert(solved_riddle) ;
write('Wrong! Try again.'), nl, fail)).
I have never heard of Prolog before so this was cool. I did think the "make sure the flashlight is turned on" point was kind of confusing. I have the battery and flashlight, but there's no way to turn it on. I couldn't run it with gprolog but swipl works fine.
When I was in school I had to do some stuff with prolog. I got my wife interested enough that she added some rooms and items to a game like this. Good times!
Very nice. I gave a lab assignment like this once! It's a great way to learn Prolog.
https://github.com/agiacalone/cecs-342-lab-prolog
There's even a book "Adventure in Prolog" by Dennis Merritt (ISBN 1520918917)
It's a lot of fun to work through, other prolog resources can be a little dry
This one? [0]
[0] https://amzi.com/AdventureInProlog/
Yes! that one!. I have a paper copy, so it didn't occur to me that there would be an online version
Going to tell the Preface story tomorrow at work, I guess if your reading this you now know my HN handle ;) Not sure I will do the 'game' but that into was worth clicking the link.
Yep. That's how I passed my Prolog course as well :)
If you wrote an adventure game in Prolog, you could write a client that would also solve the adventure.
I can imagine it's easier to write that client in Prolog than the adventure.
Just for curiosity I just asked chat deepseek to load and solve the game and it solved it in half a second.
It suggested adding some riddle, for example:
Reminds me of Dialog, a domain-specific language for writing adventure games, heavily inspired by Prolog:
https://github.com/Dialog-IF/dialog/
https://linusakesson.net/dialog/
is it generated by LLM using prompt at https://github.com/stefanrodrigues2/Prolog-Adventure-game/bl...?
Given [1], probably :)))
[1] https://github.com/stefanrodrigues2/Prolog-Adventure-game/bl...
I have never heard of Prolog before so this was cool. I did think the "make sure the flashlight is turned on" point was kind of confusing. I have the battery and flashlight, but there's no way to turn it on. I couldn't run it with gprolog but swipl works fine.
Cool! I got stuck trying to figure out how to turn on the flashlight and then got stuck in the woods and died.
When I was in school I had to do some stuff with prolog. I got my wife interested enough that she added some rooms and items to a game like this. Good times!