User Tools

Site Tools


cs175:programming_with_robocode

Robocode Introduction

    • Robocode is a programming game where the goal is to code a robot to compete against other robots in a battle arena. The player is the programmer of the robot, who will have no direct influence on the game. Instead, the player must write the AI of the robot telling it how to behave and react on events occurring in the battle arena.
    • The game is designed to help you learn Java, and have fun doing it. Robots are written in the Java(TM) Programming Language, and the Robocode game can run on any operating system supported by the Java Platform, which includes all common operative systems like Windows, Mac OS X, Linux etc.
    • See the Robocode ReadMe file for a more detailed introduction.

Getting Started

  • Install
    • In HH 305, download the latest robocode*.setup.jar archive available at http://tinyurl.com/n7e3tge.
      • Install robocode to the default folder. The instructor will guide you here.
  • Run robocode:
    • From the “Applications” menu → “Local Programs” → “Robocode”
    • OR…
    • Start a Terminal, type robocode and hit Enter.

Lab Program - Your own Robocode robot

  • Hints and Strategies
    • The robot sample.RamFire goes after the first robot detected.
      • This is not a good strategy overall, but if you want to program your robot to go after an enemy bot, look at sample.RamFire.
    • You will lose energy if you run into a wall or into another robot.
    • Many people have found that the sample.Walls robot does very well in competition.
      • Thus, it is wise if you test your robot against it.
  • Try packaging your robot in robocode to share robots with other students.
  • If you have not already done so, create a cs175 or cs501a folder under your home directory; you may use the file manager for this.
  • Copy your robot code (.java file) or your packaged robot (.jar file) to your cs175 or cs501a folder.

Additional Information

  • Future Robocode tournament announcement

cs175/programming_with_robocode.txt · Last modified: 2014/09/04 20:06 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki