Skip to content

Instantly share code, notes, and snippets.

@yan-aint-nickname
yan-aint-nickname / main.go
Created December 11, 2023 08:44
Dead simple terminal chat in go
package main
import (
"fmt"
"io"
"net"
)
const (
SERVER_HOST = "localhost"
@yan-aint-nickname
yan-aint-nickname / main.go
Created September 23, 2023 21:30
Polish notation in go
package main
import (
"errors"
"fmt"
"slices"
"unicode"
"unicode/utf8"
)
@yan-aint-nickname
yan-aint-nickname / q_rsqrt.go
Created August 24, 2023 09:03
Fast inverse square root
package main
import (
"unsafe"
)
// Assumes that number always positive
// You don't want to deal with complex numbers
func Q_rsqrt(number float32) float32 {
var i int32
@yan-aint-nickname
yan-aint-nickname / main.go
Last active October 23, 2023 16:42
SpiralCounter
package main
import "fmt"
func main() {
var rows, columns int
fmt.Scan(&rows, &columns)
matrix := make([][]int, rows)
for c := 0; c < rows; c++ {