Skip to content

Instantly share code, notes, and snippets.

@itsbth
Created August 25, 2014 17:43
Show Gist options
  • Save itsbth/0574b1e547acdfc29eef to your computer and use it in GitHub Desktop.
Save itsbth/0574b1e547acdfc29eef to your computer and use it in GitHub Desktop.
namespace FSharpBot
open Robocode
type MyFSharpBot() =
inherit Robot()
override this.Run() =
this.Initialize()
this.MainLoop()
member private this.Initialize() =
this.TurnLeft (this.Heading - 90.)
this.TurnGunRight 90.
member private this.MainLoop() =
while true do
this.ExecuteSingleStep()
member private this.ExecuteSingleStep() =
this.Ahead 5000.
this.TurnRight 90.
override this.OnScannedRobot evt =
this.Fire 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment