main.go 593 B

12345678910111213141516171819202122232425262728293031323334
  1. package main
  2. import (
  3. "surdeus.su/core/gods/maps"
  4. "fmt"
  5. )
  6. func main() {
  7. arr := maps.NewSparse[float32, string]("default", map[float32]string{
  8. 5: "something at 5",
  9. 12: "new shit 12",
  10. 50: "die 50",
  11. })
  12. for i := 0; i <= 50; i++ {
  13. fmt.Println(arr.Get(float32(i)))
  14. }
  15. fmt.Println(arr.Size())
  16. arr.Del(5)
  17. arr.Del(12)
  18. arr.Del(50)
  19. for i := 0; i <= 50; i++ {
  20. fmt.Println(arr.Get(float32(i)))
  21. }
  22. fmt.Println(arr.Size())
  23. fmt.Printf("%v\n", arr)
  24. arr.Del(12)
  25. arr.Set(10, "at 10")
  26. arr.Set(100, "at 100")
  27. arr.Set(49, "at 100")
  28. arr.Set(48.5, "at 100")
  29. fmt.Printf("%v\n", arr)
  30. }