Python Setup

Software Needed

download and install jython 2.2.1

download and install robocode 

download robot examples


Setup

add jython and robocode to path

added jython and robocode to classpath


Using Robocode

run robocode.cmd to start up 

to run using jython see the robocode-jython.sh script

-starts robocode with NoSecurity option

- needs jython.jar (though I think I added this to classpath)


FAQs

Does nosecurity add any serious issues? 

- in dev NO, programmers have access to system anyways

- in tournments, perhaps - could just run inside of linux virtual machine or similar


How easy would htis be to steup on students computers?

- python editor which can be configure to use jython

- easy way to run/edit robots in game

- easy way to install (script or installer)


What else is needed 

- comprehensive / easy to understand docs


Cleanup

My robocode-jython.sh command:


#!/bin/sh

olddir=`pwd` 

robohome="/Users/jcordiner/robocode" 

echo "Using robohome $robohome" 

cd "$robohome" 

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xmx512M -Dsun.io.useCanonCaches=false -DNOSECURITY=true -cp libs/robocode.jar:libs/codesize.jar:libs/cachecleaner.jar:/Users/jcordiner/jython2.2.1/jython.jar:. robocode.Robocode $*

# jython can be in several places

# if installed via apt-get:

# /usr/share/java/jython-2.2.1.jar

# on ubuntu 8.04 it was plain /usr/share/java/jython.jar

#

# downloaded and installed manually 

# ~/jython2.2.1/jython.jar

# or other place

echo "Goodbye!" 

cd "$olddir"


Comments