Skip to content

Instantly share code, notes, and snippets.

View orian's full-sized avatar

Paweł Szczur orian

View GitHub Profile
// Projekt6.1.1
package main
import "fmt"
func NWD(a, b int) int {
for {
if a > b {
a = a - b
} else if a < b {
// Projekt6.1.1
package main
import "fmt"
func NWD(a, b int) int {
for a != b {
if a > b {
a = a - b
} else {
@orian
orian / go_install.sh
Last active August 29, 2015 14:07
Go install script
#!/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
@orian
orian / name_gen.go
Last active August 29, 2015 14:22
pattern name generator
package main
import (
"fmt"
"path"
)
type StringGenerator interface {
Next() bool
Get() string
@orian
orian / dart-bash.sh
Last active October 6, 2015 16:18
Quick and dirty script to automagically download and unpack Dart editor.
# 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}"
@orian
orian / robot.js
Created December 4, 2012 01:22 — forked from robertomoulin/robot.js
Chewbaccax
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) {
@orian
orian / robot.js
Created December 4, 2012 01:08
ZawiszaCzarny
//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;
@orian
orian / robot.js
Created December 4, 2012 02:18 — forked from randompast/robot.js
QR-bot-002
//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);
@orian
orian / robot.js
Created December 4, 2012 02:30
Dzdzowniczka
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;
@orian
orian / robot.js
Created December 4, 2012 03:16 — forked from guilhermebruzzi/robot.js
Merry Go round
//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