Difference between revisions of "User talk:Jdev/Questions"
(RhinoScriptEngine - it's fair play or not?) |
Skilgannon (talk | contribs) (not really fair) |
||
Line 35: | Line 35: | ||
What do you think about it? | What do you think about it? | ||
--[[User:Jdev|Jdev]] 16:37, 11 November 2009 (UTC) | --[[User:Jdev|Jdev]] 16:37, 11 November 2009 (UTC) | ||
+ | |||
+ | I think it was generally agreed that using interpreted languages to bypass the codesize utility isn't exactly fair, so although you can put your bot in the rumble to see where it would score, it would be better if you didn't leave it there, because based on the amount of code you have, it probably isn't a nanobot anyways. Look at [[White Whale]] and [[Talk:White Whale]] for more discussion on this =) It's quite cool that there is an included script engine in Java, I didn't even know about it =) --[[User:Skilgannon|Skilgannon]] 17:19, 11 November 2009 (UTC) |
Revision as of 18:19, 11 November 2009
- RhinoScriptEngine - it's fair play or not?
I find out today, that there're embed script engine may be used, to reduce codesize. Example:
package lxx.test.js; import robocode.AdvancedRobot; import com.sun.script.javascript.RhinoScriptEngine; import javax.script.ScriptException; import javax.script.ScriptContext; import javax.script.SimpleScriptContext; /**sure * User: jdev * Date: 11.11.2009 */ public class JSTest extends AdvancedRobot { public void run() { RhinoScriptEngine rse = new RhinoScriptEngine(); try { ScriptContext ctx = new SimpleScriptContext(); rse.eval("var a = 100;", ctx); Double i = (Double) ctx.getAttribute("a"); ahead(i); } catch (ScriptException e) { e.printStackTrace(); } } }
so i can rewrite most part of my code on js and only call it it nanobot. but i don't sure, that it is fair. What do you think about it? --Jdev 16:37, 11 November 2009 (UTC)
I think it was generally agreed that using interpreted languages to bypass the codesize utility isn't exactly fair, so although you can put your bot in the rumble to see where it would score, it would be better if you didn't leave it there, because based on the amount of code you have, it probably isn't a nanobot anyways. Look at White Whale and Talk:White Whale for more discussion on this =) It's quite cool that there is an included script engine in Java, I didn't even know about it =) --Skilgannon 17:19, 11 November 2009 (UTC)