This site requires JavaScript, please enable it in your browser!
Greenfoot back
erdelf
erdelf wrote ...

2012/10/16

Prolog in greenfoot

erdelf erdelf

2012/10/16

#
Is there a way to implement simple prolog lines in greenfoot?
Game/maniac Game/maniac

2012/10/16

#
getBackground().setColor(Color.red);//or another color  
        getBackground().drawString("this is how you do it", 200, 300);  
If you are using an actor class replace getBackground() with getImage()
erdelf erdelf

2012/10/16

#
oh you dont know what I mean. I mean the programming language called prolog, I would like to implement cause its, like the name programming in logic says, a logical code language.
Game/maniac Game/maniac

2012/10/16

#
You would need to draw a new string for every line but its better than nothing
erdelf erdelf

2012/10/16

#
...
Game/maniac Game/maniac

2012/10/16

#
Ooh I thought you meant the prologue of a game and you accidentally spelt it wrong
Game/maniac Game/maniac

2012/10/16

#
Game/maniac wrote...
You would need to draw a new string for every line but its better than nothing
That quote was written while you posted what you meant
erdelf erdelf

2012/10/17

#
oh ok. I see. Anyone have an idea to help me with my problem?
SPower SPower

2012/10/17

#
Well, I think you can only do it by creating a database and some methods to set some things in the database.
erdelf erdelf

2012/10/17

#
I want to use the original commands of prolog, not just creating a database, something like:
String str = prolog("data.pl", "house(X));
with prolog as command, data.pl as data base file and house(X) as command
davmac davmac

2012/10/17

#
Google is your friend. A quick search gave me at least two prolog interpreter implementations in Java; you can put .jar files in the +libs folder (which you'll need to create) inside your scenario folder to incorporate them into your scenario.
You need to login to post a reply.