Difference between revisions of "Talk:OcnirpSNG"

From Robowiki
Jump to navigation Jump to search
Line 4: Line 4:
  
 
It the smallest PM I can found on the wiki right now :) Note that Simonton are excellent in codesize reduction. You might read the CodeSize/WritingSmallCode on the old wiki. Note that with his trick on variable declaration, I can take 14 bytes away from Ocnirp and have enough room for StopNGo, anyway. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 14:14, 1 March 2009 (UTC)
 
It the smallest PM I can found on the wiki right now :) Note that Simonton are excellent in codesize reduction. You might read the CodeSize/WritingSmallCode on the old wiki. Note that with his trick on variable declaration, I can take 14 bytes away from Ocnirp and have enough room for StopNGo, anyway. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 14:14, 1 March 2009 (UTC)
 +
 +
Note for you, if you don't mine to turn while you are moving, you can reduce codesize to 227, if not, 237.
 +
* The e.getDistance() called twice, declare a variable.
 +
* Note that instead of degrees, use radians. The turn code will look like setTurnRightRadians((Math.cos(absB = e.getBearingRadians()) + direction * -0.174532925D));
 +
* As you will see above, use Math.cos will move in perpendicular automatically. (I don't know why, but ripped from WeekendObsession)
 +
* Move the turn code before the gun code, assign the e.getBearingRadians() to absB first, then in gun, use += getHeadingRadians();
 +
That all I squeeze the Scytodes, note that we use the same gun :) &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 14:28, 1 March 2009 (UTC)

Revision as of 16:28, 1 March 2009

Shall I proud with this bot? I own only half of it. » Nat | Talk » 12:11, 1 March 2009 (UTC)

Good bot! I'm trying to put random movement to Scytodes, but I can't make it less than 266 bytes... Maybe Simonton's gun costs less codesize? --HUNRobar 12:58, 1 March 2009 (UTC)

It the smallest PM I can found on the wiki right now :) Note that Simonton are excellent in codesize reduction. You might read the CodeSize/WritingSmallCode on the old wiki. Note that with his trick on variable declaration, I can take 14 bytes away from Ocnirp and have enough room for StopNGo, anyway. » Nat | Talk » 14:14, 1 March 2009 (UTC)

Note for you, if you don't mine to turn while you are moving, you can reduce codesize to 227, if not, 237.

  • The e.getDistance() called twice, declare a variable.
  • Note that instead of degrees, use radians. The turn code will look like setTurnRightRadians((Math.cos(absB = e.getBearingRadians()) + direction * -0.174532925D));
  • As you will see above, use Math.cos will move in perpendicular automatically. (I don't know why, but ripped from WeekendObsession)
  • Move the turn code before the gun code, assign the e.getBearingRadians() to absB first, then in gun, use += getHeadingRadians();

That all I squeeze the Scytodes, note that we use the same gun :) » Nat | Talk » 14:28, 1 March 2009 (UTC)