This is my first post. I have been teaching myself Prolog for a university project and I am tasked with generating a program that simulates the lotto and compares the random numbers (6 in this case) with the numbers that the user has. If they all match then you are deemed the winner if not, then it returns 'hard luck'.
All I have been able to do so far is generate one random number in the range of 1-50. I don't know how to do much else after that.
:- use_module(library(random)).
?- random(1,50,Out).
I understand I have to add the random number to a list, but I'm not sure how to implement it. And to then have another list of numbers (user_numbers) in the database or fact-base. Then use SWI-Prolog to check if they're equal.
It is a really tough program for me to try and do in Prolog, especially seeing as I am teaching it to myself. If anybody could give me some pointers on how to approach it I would be very grateful.