This file contains 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
// Projekt6.1.1 | |
package main | |
import "fmt" | |
func NWD(a, b int) int { | |
for { | |
if a > b { | |
a = a - b | |
} else if a < b { |
This file contains 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
// Projekt6.1.1 | |
package main | |
import "fmt" | |
func NWD(a, b int) int { | |
for a != b { | |
if a > b { | |
a = a - b | |
} else { |
This file contains 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
#!/bin/bash | |
# 1. Save file as go_install.sh | |
# 2. chmod +x go_install.sh | |
# 3. ./go_install.sh | |
# 4. Profit. | |
# Get Go package | |
PKGNAME=go1.3.3.linux-amd64.tar.gz | |
rm -f $PKGNAME | |
wget https://storage.googleapis.com/golang/$PKGNAME |
This file contains 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
package main | |
import ( | |
"fmt" | |
"path" | |
) | |
type StringGenerator interface { | |
Next() bool | |
Get() string |
This file contains 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
# just add copy&paste to your .bashrc | |
# require wget, unzip | |
DART_PKG_NAME="darteditor-linux-64.zip" | |
#If variable is not defined, set variable. | |
check-env-var() { | |
X=$1 | |
if [ -z "${!X}" ]; then | |
export $X=$2 | |
echo "export $X=${!X}" |
This file contains 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
var Robot = function(robot) { | |
robot.clone(); | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(40); | |
robot.rotateCannon(360);}; | |
Robot.prototype.onScannedRobot = function(ev) { |
This file contains 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) { | |
this.lastHitAngle = 0; | |
this.radius = 20; | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; |
This file contains 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.turn(1); | |
robot.ahead(2); |
This file contains 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
var Robot = function(robot) { | |
}; | |
Robot.prototype.lastHitAngle = -1; | |
Robot.prototype.radius = 20; | |
Robot.prototype.hit = 0; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
this.hit = 0; |
This file contains 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.clone(); | |
this.robotOptions = { | |
clone: { | |
canStartFight: false, | |
goBackOnCollision: false |