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
package main | |
import( | |
. "bytes" | |
"crypto/aes" | |
"crypto/rand" | |
. "crypto/block" | |
"os" | |
"io" | |
"io/ioutil" |
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
package main | |
import "fmt" | |
type Point struct { | |
a, b, c, d, e int | |
} | |
func main(){ | |
points := newPoints( |
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
package main | |
import "fmt" | |
import "exp/iterable" | |
func main(){ | |
a := iterable.IntArray{1,2,3,4} | |
fmt.Println(a) | |
iter := iterable.Map(a, func(i interface{})(interface{}){ return i.(int) * 3 }) | |
for e := range iter.Iter() { |
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
#!/usr/bin/ruby -w | |
=begin | |
/*************************************************************************** | |
* Copyright (C) 2008, Paul Lutus * | |
* * | |
* This program is free software; you can redistribute it and/or modify * | |
* it under the terms of the GNU General Public License as published by * | |
* the Free Software Foundation; either version 2 of the License, or * |
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
type Vector struct { | |
y, x float64 | |
} | |
func (self *Vector) Normalize() { | |
length := self.Length() | |
self.y /= length | |
self.x /= length | |
} |
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
package main | |
import ( | |
"sdl" | |
"math" | |
"time" | |
"rand" | |
"flag" | |
"fmt" | |
) |
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 "math" | |
type Float float64 | |
var Infinity = Float(math.Inf(0)) | |
func (f Float) Abs() Float { | |
return Float(math.Fabs(float64(f))) | |
} |
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
package chipmunk | |
import "fmt" | |
type Vect struct { | |
X, Y Float | |
} | |
func vect(x, y Float) *Vect { | |
return &Vect{x, y} |
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
// Conway's Game of Life. | |
package main | |
import ( | |
"sdl" | |
"rand" | |
"time" | |
"strings" | |
"strconv" |