This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.onIdle = function(ev) { | |
| var robot = ev.robot; | |
| robot.ahead(15*(1+Math.random())); | |
| robot.turn(10*(1+Math.random())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Robot(robot) {} | |
| Robot.prototype.onIdle = function(ev) { | |
| var robot; | |
| robot = ev.robot; | |
| robot.ahead(130); | |
| robot.rotateCannon(50); | |
| robot.back(130); | |
| robot.rotateCannon(50); | |
| if(robot.life==100) | |
| robot.clone() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //For finding and tracking other bots | |
| self.pos = [0,0,0,0,0]; | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.onIdle = function(ev) { | |
| var robot = ev.robot; | |
| var predictedPos = predictRobot(); | |
| robot.rotateCannon(20); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from bs4 import BeautifulSoup | |
| import jsbeautifier | |
| import os | |
| import sys | |
| import re | |
| def beautifyObject(filePath): | |
| f = open(filePath, 'r+') | |
| obj = BeautifulSoup(f, 'xml') | |
| f.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (this.mc.gameSettings.heldItemTooltips) | |
| { | |
| this.mc.mcProfiler.startSection("toolHighlight"); | |
| if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) | |
| { | |
| s1 = this.highlightingItemStack.getDisplayName(); | |
| k1 = (k - fontrenderer.getStringWidth(s1)) / 2; | |
| i2 = l - 59; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3) | |
| { | |
| List list = par1ItemStack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); | |
| for (int k = 0; k < list.size(); ++k) | |
| { | |
| if (k == 0) | |
| { | |
| list.set(k, "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + (String)list.get(k)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void drawHoveringText(List par1List, int par2, int par3, FontRenderer font) | |
| { | |
| if (!par1List.isEmpty()) | |
| { | |
| GL11.glDisable(GL12.GL_RESCALE_NORMAL); | |
| RenderHelper.disableStandardItemLighting(); | |
| GL11.glDisable(GL11.GL_LIGHTING); | |
| GL11.glDisable(GL11.GL_DEPTH_TEST); | |
| int k = 0; | |
| Iterator iterator = par1List.iterator(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bool NetworkListener::initialize(ENetAddress *address, const char *baseKey) | |
| { | |
| if (enet_initialize () != 0) | |
| return false; | |
| atexit(enet_deinitialize); | |
| _server = enet_host_create(address, 32, 0, 0); | |
| if(_server == NULL) | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import util | |
| try: | |
| import wpilib | |
| except ImportError: | |
| from pyfrc import wpilib | |
| class RobotGuy(wpilib.SimpleRobot): | |
| def __init__(self): |