initial commit

This commit is contained in:
onyx-and-iris
2022-11-05 18:58:36 +00:00
parent 5dcf3fbc28
commit 4fd0fdbc56
7 changed files with 293 additions and 2 deletions

11
util.go Normal file
View File

@@ -0,0 +1,11 @@
package main
// indexOf returns the index of an element in an array
func indexOf[T comparable](collection []T, e T) int {
for i, x := range collection {
if x == e {
return i
}
}
return -1
}