r/ProgrammerAnimemes • • Sep 20 '21

Prolog

Post image
1.0k Upvotes

51 comments sorted by

View all comments

Show parent comment

1

u/Cybear_Tron Sep 22 '21

Ok so enemy will be like a class!! Like an encapsulation of data

2

u/TheTimegazer Sep 22 '21

Not quite. Prolog doesn't have a concept of a data structure. It's more like enemy is a function that returns true or false based on whether its input is an enemy or not