It is currently Mon Jul 23, 2018 4:23 am Advanced search

Javascript ..how to run

Code won't compile? Found a bug? Post here!

Javascript ..how to run

Postby daztay » Wed Feb 10, 2010 11:51 am

How ca you run a javascript on the simulator I have tried

java -jar engine/Tron.jar maps/apocalyptic.txt "javascript -js wallbot.js" "java -jar example_bots/RandomBot.jar"

and

java -jar engine/Tron.jar maps/apocalyptic.txt "javascript wallbot.js" "java -jar example_bots/RandomBot.jar"

thanks
daztay
Cadet
 
Posts: 2
Joined: Wed Feb 10, 2010 11:46 am

Re: Javascript ..how to run

Postby blueiris » Wed Feb 10, 2010 12:40 pm

First you must install the Node.js command-line JavaScript runtime from http://nodejs.org/

That will give you a "node" command line tool that executed JavaScript scripts in a POSIX environment.

Once you have that, you can run your bot by using the "node" command:

java -jar engine/Tron.jar maps/apocalyptic.txt "node wallbot.js" "java -jar example_bots/RandomBot.jar"
blueiris
Cadet
 
Posts: 9
Joined: Sat Feb 06, 2010 8:53 am

Re: Javascript ..how to run

Postby daztay » Wed Feb 10, 2010 9:30 pm

thanks
I will give it a go
daztay
Cadet
 
Posts: 2
Joined: Wed Feb 10, 2010 11:46 am


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 3 guests

cron