Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
  • Loading branch information
moul committed Apr 2, 2023
1 parent 8faf62d commit 57bec96
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 24 deletions.
6 changes: 3 additions & 3 deletions examples/gno.land/r/demo/art/gnoface/gnoface.gno
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ func Draw(seed int64) string {

r := rand.FromSeed(seed)

output := pick(r, hairs) + "\n" +
return "```\n" +
pick(r, hairs) + "\n" +
pick(r, headtop) + "\n" +
pick(r, headspace) + "\n" +
" | " + pick(r, eyebrow) + " " + pick(r, eyebrow) + " |\n" +
Expand All @@ -114,8 +115,7 @@ func Draw(seed int64) string {
pick(r, headspace) + "\n" +
pick(r, mouth) + "\n" +
pick(r, headspace) + "\n" +
pick(r, headbottom)
return output
pick(r, headbottom) + "\n```\n"
}

func pick(r *rand.Instance, slice []string) string {
Expand Down
33 changes: 18 additions & 15 deletions examples/gno.land/r/demo/art/gnoface/gnoface_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestGnoface(t *testing.T) {
}{
{
seed: 42,
expected: `
expected: "```" + `
|||||||
////////\
| |
Expand All @@ -24,11 +24,12 @@ func TestGnoface(t *testing.T) {
| |
| __/ |
| |
\~~~~~~~/`[1:],
\~~~~~~~/
` + "```\n",
},
{
seed: 1337,
expected: `
expected: "```" + `
s
/|||||||\
| |
Expand All @@ -39,11 +40,12 @@ o| ~ ~ |.
| |
| __/ |
| |
\_______/`[1:],
\_______/
` + "```\n",
},
{
seed: 123456789,
expected: `
expected: "```" + `
s
/~~~~~~~\
| |
Expand All @@ -54,7 +56,8 @@ o| ~ ~ |.
| |
| \_/ |
| |
\-------/`[1:],
\-------/
` + "```\n",
},
}
for _, tc := range cases {
Expand All @@ -75,8 +78,7 @@ func TestRender(t *testing.T) {
}{
{
path: "42",
expected: `
Gnoface #42
expected: "Gnoface #42\n```" + `
|||||||
////////\
| |
Expand All @@ -87,12 +89,12 @@ Gnoface #42
| |
| __/ |
| |
\~~~~~~~/`[1:],
\~~~~~~~/
` + "```\n",
},
{
path: "1337",
expected: `
Gnoface #1337
expected: "Gnoface #1337\n```" + `
s
/|||||||\
| |
Expand All @@ -103,12 +105,12 @@ o| ~ ~ |.
| |
| __/ |
| |
\_______/`[1:],
\_______/
` + "```\n",
},
{
path: "123456789",
expected: `
Gnoface #123456789
expected: "Gnoface #123456789\n```" + `
s
/~~~~~~~\
| |
Expand All @@ -119,7 +121,8 @@ Gnoface #123456789
| |
| \_/ |
| |
\-------/`[1:],
\-------/
` + "```\n",
},
}
for _, tc := range cases {
Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/r/demo/art/millipede/millipede.gno
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
maxSize = 100
)

func Millipede(size int) string {
func Draw(size int) string {
if size < minSize || size > maxSize {
panic("invalid millipede size")
}
Expand All @@ -38,7 +38,7 @@ func Render(path string) string {
}
}

output := Millipede(size)
output := "```\n" + Draw(size) + "```\n"
if size > minSize {
output += ufmt.Sprintf("[%d](/r/art/millpede:%d)< ", size-1, size-1)
}
Expand Down
8 changes: 4 additions & 4 deletions examples/gno.land/r/demo/art/millipede/millipede_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestRender(t *testing.T) {
}{
{
path: "",
expected: `
expected: "```" + `
╚⊙ ⊙╝
╚═(███)═╝
╚═(███)═╝
Expand All @@ -34,17 +34,17 @@ func TestRender(t *testing.T) {
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
[19](/r/art/millpede:19)< >[21](/r/art/millipede:21)`[1:],
` + "```\n[19](/r/art/millpede:19)< >[21](/r/art/millipede:21)",
},
{
path: "4",
expected: `
expected: "```" + `
╚⊙ ⊙╝
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
[3](/r/art/millpede:3)< >[5](/r/art/millipede:5)`[1:],
` + "```\n[3](/r/art/millpede:3)< >[5](/r/art/millipede:5)",
},
}

Expand Down

0 comments on commit 57bec96

Please sign in to comment.