Skip to content

Instantly share code, notes, and snippets.

@monkrus
Created April 28, 2022 05:24
Show Gist options
  • Save monkrus/7ae46a521af0f212217984edfce2b23c to your computer and use it in GitHub Desktop.
Save monkrus/7ae46a521af0f212217984edfce2b23c to your computer and use it in GitHub Desktop.
package main
import "fmt"
type material func(x, y int) int
func main() {
var explosion material = func(elemX, elemY int) int {
return elemX + elemY
}
boom := explosion(2, 4)
fmt.Println("The result is a huge explosion that has the radius of", boom, "meters")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment