Skip to content

Instantly share code, notes, and snippets.

@jmhofer
Created August 4, 2012 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmhofer/3260241 to your computer and use it in GitHub Desktop.
Save jmhofer/3260241 to your computer and use it in GitHub Desktop.
Robocode with F#: Very First Steps
#light
namespace johofer
open Robocode
type SharpyTheFirst() =
inherit Robot()
#light
namespace johofer
open Robocode
type SharpyTheFirst() =
inherit Robot()
override this.Run() =
this.Initialize()
this.MainLoop()
member private this.Initialize() =
this.TurnLeft (this.Heading - 90.0)
this.TurnGunRight 90.0
member private this.MainLoop() =
while true do
this.ExecuteSingleStep()
member private this.ExecuteSingleStep() =
this.Ahead 5000.0
this.TurnRight 90.0
override this.OnScannedRobot e =
this.Fire 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment