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
func drawBlock(x, y int, color TetrisBlockColor) { | |
gl.Color3ub(gl.GLubyte(color.R/2),gl.GLubyte(color.G/2),gl.GLubyte(color.B/2)) | |
gl.Begin(gl.QUADS) | |
gl.Vertex2i(gl.GLint(x ), gl.GLint(y)) | |
gl.Vertex2i(gl.GLint(x + blockSize), gl.GLint(y)) | |
gl.Vertex2i(gl.GLint(x + blockSize), gl.GLint(y + blockSize)) | |
gl.Vertex2i(gl.GLint(x ), gl.GLint(y + blockSize)) | |
gl.Color3ub(gl.GLubyte(color.R),gl.GLubyte(color.G),gl.GLubyte(color.B)) | |
gl.Vertex2i(gl.GLint(x + smallBlockOffset ), gl.GLint(y + smallBlockOffset)) | |
gl.Vertex2i(gl.GLint(x + blockSize - smallBlockOffset), gl.GLint(y + smallBlockOffset)) |
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
func drawBlock(x, y int, color TetrisBlockColor) { | |
glx := gl.GLint(x) | |
gly := gl.GLint(y) | |
gl.Color3ub(gl.GLubyte(color.R/2),gl.GLubyte(color.G/2),gl.GLubyte(color.B/2)) | |
gl.Begin(gl.QUADS) | |
gl.Vertex2i(glx, gly) | |
gl.Vertex2i(glx + blockSize, gly) | |
gl.Vertex2i(glx + blockSize, gly + blockSize) | |
gl.Vertex2i(glx, gly + blockSize) |
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 ( | |
"sdl" | |
"gl" | |
"unsafe" | |
"flag" | |
"runtime" | |
) |
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
void | |
·_C_SDL_PollEvent(struct{uint8 x[8];}p) | |
{ | |
cgocall(_cgo_SDL_PollEvent, &p); | |
} |
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 ( | |
"runtime" | |
"time" | |
) | |
const iterations = 1024 | |
type Color struct { |
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 ( | |
"runtime" | |
"time" | |
) | |
func doCalc(amount int) <-chan []byte { | |
result := make(chan []byte, 10) | |
go func() { |
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" | |
func Server_SayHello(notused int) int { | |
fmt.Printf("Hello, World!\n") | |
return 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
package main | |
import ( | |
"io/ioutil" | |
"go/parser" | |
"strings" | |
"reflect" | |
"flag" | |
"go/ast" | |
"bytes" |
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
" Modified by nsf <[email protected]> | |
" Vim color file | |
" baycomb v1.8b | |
" http://www.vim.org/scripts/script.php?script_id=1454 | |
" | |
" Maintainer: Shawn Axsom <[email protected]> | |
" | |
" * Place :colo baycomb in your VimRC/GVimRC file | |
" * GvimRC if using GUI any | |
" |
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
(defun ac-go-candidates () | |
(ac-go-autocomplete)) | |
(defvar ac-source-go | |
'((candidates . ac-go-candidates) | |
(prefix . "\\.\\(.*\\)") | |
(requires . 0))) | |
(setq ac-sources '(ac-source-go)) |
OlderNewer