Skip to content

Commit

Permalink
chore: update test4.gno.land backup
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton authored and github-actions[bot] committed Oct 9, 2024
1 parent 0549227 commit 9c0ae4f
Show file tree
Hide file tree
Showing 22 changed files with 923 additions and 9 deletions.
19 changes: 11 additions & 8 deletions test4.gno.land/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## TXs
```
19973
20025
```

## addpkgs
Expand All @@ -11,17 +11,17 @@

## top realm calls
```
4383 "gno.land/r/demo/wugnot"
4393 "gno.land/r/demo/wugnot"
1142 "gno.land/r/gnoswap/gns"
908 "gno.land/r/gnoswap/v2/gns"
912 "gno.land/r/gnoswap/v2/gns"
764 "gno.land/r/gnoswap/router"
755 "gno.land/r/gnoswap/position"
726 "gno.land/r/gnoswap/v2/router"
728 "gno.land/r/gnoswap/v2/router"
654 "gno.land/r/gnoswap/gnft"
621 "gno.land/r/onbloc/usdc"
623 "gno.land/r/onbloc/usdc"
605 "gno.land/r/gnoswap/v2/position"
604 "gno.land/r/onbloc/foo"
428 "gno.land/r/gnoswap/v2/staker"
430 "gno.land/r/gnoswap/v2/staker"
409 "gno.land/r/gnoswap/v2/gnft"
350 "gno.land/r/onbloc/bar"
320 "gno.land/r/gnoswap/staker"
Expand All @@ -30,7 +30,7 @@
159 "gno.land/r/onbloc/obl"
113 "gno.land/r/g17ernafy6ctpcz6uepfsq2js8x2vz0wladh5yc3/zentasktic_core"
112 "gno.land/r/gnoswap/pool"
95 "gno.land/r/demo/users"
97 "gno.land/r/demo/users"
92 "gno.land/r/gov/dao"
86 "gno.land/r/teritori/social_feeds"
70 "gno.land/r/g1ngywvql2ql7t8uzl63w60eqcejkwg4rm4lxdw9/candy20"
Expand All @@ -40,6 +40,7 @@
30 "gno.land/r/varmeta/demo/v405/domain/registrar"
26 "gno.land/r/g1w6886hdj2tet0seyw6kn8fl92sx06prgd9w9j8/game/v3/diceroller"
25 "gno.land/r/varmeta/demo/v403/domain/registrar"
22 "gno.land/r/ecodevx/dao/pre1"
21 "gno.land/r/g1w62226g8hykfmtuasvz80rdf0jl6phgxsphh5v/testing/openocean"
20 "gno.land/r/g1w6886hdj2tet0seyw6kn8fl92sx06prgd9w9j8/games/diceroller"
18 "gno.land/r/teritori/projects_manager"
Expand All @@ -54,14 +55,15 @@
10 "gno.land/r/varmeta/demo/v33/domain/registrar"
10 "gno.land/r/varmeta/demo/v36/domain/registrar"
10 "gno.land/r/varmeta/demo/v39/domain/registrar"
10 "gno.land/r/villaquiranm/ghverify"
9 "gno.land/r/demo/boards"
8 "gno.land/r/g1e5hud66rs7ye4zgeqmqvwfhurs2mnf408hdqcl/feedback_v1"
8 "gno.land/r/g1ej0qca5ptsw9kfr64ey8jvfy9eacga6mpj2z0y/ih1"
8 "gno.land/r/molaryy/openocean"
8 "gno.land/r/varmeta/demo/v2/domain/registrar"
8 "gno.land/r/varmeta/demo/v401/domain/registrar"
8 "gno.land/r/varmeta/registrar"
7 "gno.land/r/g1w62226g8hykfmtuasvz80rdf0jl6phgxsphh5v/testing/forms2"
7 "gno.land/r/villaquiranm/ghverify"
6 "gno.land/r/g1w62226g8hykfmtuasvz80rdf0jl6phgxsphh5v/testing/disperse2"
6 "gno.land/r/g1w6886hdj2tet0seyw6kn8fl92sx06prgd9w9j8/game/diceroller"
6 "gno.land/r/g1w6886hdj2tet0seyw6kn8fl92sx06prgd9w9j8/game/v1/diceroller"
Expand All @@ -80,6 +82,7 @@
4 "gno.land/r/sys/users"
4 "gno.land/r/taskow/tasks"
3 "gno.land/r/demo/userbook"
3 "gno.land/r/ecodevx/space/pre1"
3 "gno.land/r/g1w62226g8hykfmtuasvz80rdf0jl6phgxsphh5v/testing/forms"
3 "gno.land/r/g1w6886hdj2tet0seyw6kn8fl92sx06prgd9w9j8/games/v1/diceroller"
3 "gno.land/r/gnoswap/v2/community_pool"
Expand Down
52 changes: 52 additions & 0 deletions test4.gno.land/backup_2328335-2360024.jsonl

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package hello

func Render(path string) string {
return "Hello World!"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"creator":"g15ruzptpql4dpuyzej0wkt5rq6r26kw4nxu9fwd","deposit":""}
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
package ih

import (
"gno.land/p/demo/avl"
"gno.land/p/demo/ufmt"
"std"
)

var (
images []string
scores avl.Tree
)

func init() {
scores = *avl.NewTree()
images = []string{
"https://gno.land/static/img/og-gnoland.png",
"https://schollz.com/img/gno.png",
"https://pbs.twimg.com/media/FmxJDJ_XoAAX27f.jpg:large",
"https://play.gno.land/og-playground-2.png",
"https://images.lumacdn.com/cdn-cgi/image/format=auto,fit=cover,dpr=1,background=white,quality=75,width=400,height=400/event-covers/4w/f8751196-bf78-47dc-8879-320198ab8176",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRXK4i0tjkqCBIE19j2E1-v-Eyigybfkanibw&s",
"https://airdrops.one/wp-content/uploads/2022/04/gno-land-logo.jpeg",
"https://img.itch.zone/aW1nLzExMjM5OTM1LnBuZw==/original/vD1tZS.png",
"https://avatars.githubusercontent.com/u/75237105?v=4",
"https://mythicalcreatures.info/media/gnome-mythical-creatures-1200x900.jpg",
"https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/Blockchain%20Technology.jpg",
"https://coinbureau.com/_next/image/?url=https%3A%2F%2Fimage.coinbureau.com%2Fstrapi%2FCosmos_Ecosystem_2df2597248.jpg&w=2048&q=50",
"https://cdn.decrypt.co/wp-content/uploads/2020/01/jae-kwon-gID_1.jpg",
"https://cdn.hashnode.com/res/hashnode/image/upload/v1659512725142/BlwUf2u16.png",
"https://gnoscan.io/gnoscan-thumb.png",
}
}

func GetSingleImage(index int) string {
return images[index]
}

func GetImages() []string {
return images
}

func Register(address std.Address) {
scores.Set(address.String(), 0)
}

func GetScore(address std.Address) int {
value, exists := scores.Get(address.String())
if exists {
return value.(int)
} else {
return -1
}
}

func SetScore(address std.Address, score int) {
scores.Set(address.String(), score)
}

func GetTop10() []struct {
address string
points int
} {
var topScores []struct {
address string
points int
}

scores.ReverseIterate("", "", func(key string, value interface{}) bool {
topScores = append(topScores, struct {
address string
points int
}{address: key, points: value.(int)})

return len(topScores) >= 10
})

return topScores
}

func Render(_ string) string {
out := "<div style='font-family: \"Trebuchet MS\", sans-serif; font-size: 5rem; color: #000000;'>\n\n"
out += "# Memory Game\n\n"
out += "</div>\n\n"

// Game Images section
out += "<div style='font-family: \"Trebuchet MS\", sans-serif; text-align: justify;'>\n\n"
for _, img := range images {
out += "<img src='" + img + "' style='width: 100px; height: 100px; margin: 5px;' />\n"
}
out += "</div>"

// Scoreboard section
out += "<div style='margin-top: 20px;'>\n"
out += "<h2 style='font-family: \"Trebuchet MS\", sans-serif;'>Top 5 Scores</h2>\n"

// Table styling
out += "<table style='width: 100%; border-collapse: collapse; text-align: center; font-family: \"Trebuchet MS\", sans-serif;'>\n"
out += "<thead style='; color: white;'>\n"
out += "<tr>\n"
out += "<th style='padding: 10px; border: 1px solid #ddd;'>Rank</th>\n"
out += "<th style='padding: 10px; border: 1px solid #ddd;'>Address</th>\n"
out += "<th style='padding: 10px; border: 1px solid #ddd;'>Points</th>\n"
out += "</tr>\n"
out += "</thead>\n"

// Table body for top scores
out += "<tbody>\n"
topScores := GetTopScores(5)
for i, score := range topScores {
out += "<tr style='border: 1px solid #ddd;'>\n"
out += ufmt.Sprintf("<td style='padding: 8px;'>%d</td>\n", i+1)
out += ufmt.Sprintf("<td style='padding: 8px;'>%s</td>\n", score.address)
out += ufmt.Sprintf("<td style='padding: 8px;'>%d</td>\n", score.points)
out += "</tr>\n"
}
out += "</tbody>\n"
out += "</table>\n"
out += "</div>"

return out
}

// Helper function to get the top N scores
func GetTopScores(n int) []struct {
address string
points int
} {
var topScores []struct {
address string
points int
}

// Reverse iterate through the tree to get the top scores
scores.ReverseIterate("", "", func(key string, value interface{}) bool {
topScores = append(topScores, struct {
address string
points int
}{address: key, points: value.(int)})

// Stop after collecting N scores
return len(topScores) >= n
})

return topScores
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"creator":"g1ej0qca5ptsw9kfr64ey8jvfy9eacga6mpj2z0y","deposit":""}
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
package ih1

import (
"gno.land/p/demo/avl"
"gno.land/p/demo/ufmt"
"std"
)

var (
images []string
scores avl.Tree
)

func init() {
scores = *avl.NewTree()
images = []string{
"https://gno.land/static/img/og-gnoland.png",
"https://schollz.com/img/gno.png",
"https://pbs.twimg.com/media/FmxJDJ_XoAAX27f.jpg:large",
"https://play.gno.land/og-playground-2.png",
"https://images.lumacdn.com/cdn-cgi/image/format=auto,fit=cover,dpr=1,background=white,quality=75,width=400,height=400/event-covers/4w/f8751196-bf78-47dc-8879-320198ab8176",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRXK4i0tjkqCBIE19j2E1-v-Eyigybfkanibw&amp;s",
"https://airdrops.one/wp-content/uploads/2022/04/gno-land-logo.jpeg",
"https://img.itch.zone/aW1nLzExMjM5OTM1LnBuZw==/original/vD1tZS.png",
"https://avatars.githubusercontent.com/u/75237105?v=4",
"https://mythicalcreatures.info/media/gnome-mythical-creatures-1200x900.jpg",
"https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/Blockchain%20Technology.jpg",
"https://coinbureau.com/_next/image/?url=https%3A%2F%2Fimage.coinbureau.com%2Fstrapi%2FCosmos_Ecosystem_2df2597248.jpg&amp;w=2048&amp;q=50",
"https://cdn.decrypt.co/wp-content/uploads/2020/01/jae-kwon-gID_1.jpg",
"https://cdn.hashnode.com/res/hashnode/image/upload/v1659512725142/BlwUf2u16.png",
"https://gnoscan.io/gnoscan-thumb.png",
}
}

func GetSingleImage(index int) string {
return images[index]
}

func GetImages() []string {
return images
}

func Register(address std.Address) {
scores.Set(address.String(), 0)
}

func GetScore(address std.Address) int {
value, exists := scores.Get(address.String())
if exists {
return value.(int)
} else {
return -1
}
}

func SetScore(address std.Address, score int) {
scores.Set(address.String(), score)
}

func GetTop10() string {
var topScores []struct {
address string
points int
}

scores.ReverseIterate("", "", func(key string, value interface{}) bool {
topScores = append(topScores, struct {
address string
points int
}{address: key, points: value.(int)})

//return len(topScores) >= 10
})

var result string
for i, score := range topScores {
result += ufmt.Sprintf("%d. %s: %d points\n", i+1, score.address, score.points)
}
return result
}

func Render(_ string) string {
out := "<div style='font-family: \"Trebuchet MS\", sans-serif; font-size: 5rem; color: #000000;'>\n\n"
out += "# Memory Game\n\n"
out += "</div>\n\n"

// Game Images section
out += "<div style='font-family: \"Trebuchet MS\", sans-serif; text-align: justify;'>\n\n"
for _, img := range images {
out += "<img src='" + img + "' style='width: 100px; height: 100px; margin: 5px;' />\n"
}
out += "</div>"

// Scoreboard section
out += "<div style='margin-top: 20px;'>\n"
out += "<h2 style='font-family: \"Trebuchet MS\", sans-serif;'>Top 5 Scores</h2>\n"

// Table styling
out += "<table style='width: 100%; border-collapse: collapse; text-align: center; font-family: \"Trebuchet MS\", sans-serif;'>\n"
out += "<thead style='; color: white;'>\n"
out += "<tr>\n"
out += "<th style='padding: 10px; border: 1px solid #ddd;'>Rank</th>\n"
out += "<th style='padding: 10px; border: 1px solid #ddd;'>Address</th>\n"
out += "<th style='padding: 10px; border: 1px solid #ddd;'>Points</th>\n"
out += "</tr>\n"
out += "</thead>\n"

// Table body for top scores
out += "<tbody>\n"
topScores := GetTopScores(5)
for i, score := range topScores {
out += "<tr style='border: 1px solid #ddd;'>\n"
out += ufmt.Sprintf("<td style='padding: 8px;'>%d</td>\n", i+1)
out += ufmt.Sprintf("<td style='padding: 8px;'>%s</td>\n", score.address)
out += ufmt.Sprintf("<td style='padding: 8px;'>%d</td>\n", score.points)
out += "</tr>\n"
}
out += "</tbody>\n"
out += "</table>\n"
out += "</div>"

return out
}

// Helper function to get the top N scores
func GetTopScores(n int) []struct {
address string
points int
} {
var topScores []struct {
address string
points int
}

// Reverse iterate through the tree to get the top scores
scores.ReverseIterate("", "", func(key string, value interface{}) bool {
topScores = append(topScores, struct {
address string
points int
}{address: key, points: value.(int)})

// Stop after collecting N scores
return len(topScores) >= n
})

return topScores
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"creator":"g1ej0qca5ptsw9kfr64ey8jvfy9eacga6mpj2z0y","deposit":""}
Loading

0 comments on commit 9c0ae4f

Please sign in to comment.