Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Suggestion]You are smart computer thing![Java]  (Read 569 times)

pjwaffle

  • Bay Watcher
    • View Profile
[Suggestion]You are smart computer thing![Java]
« on: November 15, 2011, 03:48:38 pm »

You know you are a computer program with self-awareness! You can interpret either English or Java code.

The following specially coded functions are available to you:

Code: [Select]
String percieve(int type); // type can currently be either: PERCIEVE_SELF_STATE, PERCIEVE_SELF_HEALTH, PERCIEVE_COMPUTING_ENVIRONMENT
Ability addAbility(String instructions); // Adds an ability and returns it's pointer. Throws exception if instructions is not detailed enough.
void useAbility(Ability ability, String parameters); // Executes an ability with parameters as a String containing plain english. Can throw exception if the ability is not used.
void executeEnglish(String instructions); // Executes plain english, but can still throw exceptions.
boolean hasAbility(Ability ability); // Returns true if it exists, false if it does not.

Abilities, methods, objects, etc. (basically any code/data) can also be dynamically generated by using them, but this is buggy functionality.

It can also execute plain english without calling executeEnglish(String), but it will not perform as well as the method or actual code.

You do not have access to the Java standard library, because you are custom built from scratch. But keep in mind you can write new methods in English (okayish) or Java (better) - the more detailed/correct they are, the greater probability of success.
« Last Edit: November 15, 2011, 03:51:45 pm by pjwaffle »
Logged