Skip to content

Commit

Permalink
put println back again
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Feb 25, 2025
1 parent ebbe286 commit d01b08e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/gno.land/p/demo/tamagotchi/z0_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
println(t.Markdown())

println("\n-- WAIT 20 minutes\n")
os_test.Sleep(20 * time.Minute)
os.Sleep(20 * time.Minute)
println(t.Markdown())

println("\n-- FEEDx3, PLAYx2, HEALx4\n")
Expand All @@ -30,15 +30,15 @@ func main() {
println(t.Markdown())

println("\n-- WAIT 20 minutes\n")
os_test.Sleep(20 * time.Minute)
os.Sleep(20 * time.Minute)
println(t.Markdown())

println("\n-- WAIT 20 hours\n")
os_test.Sleep(20 * time.Hour)
os.Sleep(20 * time.Hour)
println(t.Markdown())

println("\n-- WAIT 20 hours\n")
os_test.Sleep(20 * time.Hour)
os.Sleep(20 * time.Hour)
println(t.Markdown())
}

Expand Down
21 changes: 21 additions & 0 deletions gnovm/pkg/gnolang/uverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,27 @@ func makeUverseNode() {
m.Output.Write([]byte(rs))
},
)
defNative("println",
Flds( // param
"xs", Vrd(AnyT()), // args[0]
),
nil, // results
func(m *Machine) {
arg0 := m.LastBlock().GetParams1()
xv := arg0
xvl := xv.TV.GetLength()
ss := make([]string, xvl)
for i := 0; i < xvl; i++ {
ev := xv.TV.GetPointerAtIndexInt(m.Store, i).Deref()
ss[i] = ev.Sprint(m)
}
rs := strings.Join(ss, " ") + "\n"
if debug {
println("DEBUG/stdout: " + rs)
}
m.Output.Write([]byte(rs))
},
)
defNative("recover",
nil, // params
Flds( // results
Expand Down
1 change: 0 additions & 1 deletion gnovm/tests/stdlibs/os/os.gno
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ func Sleep(duration int64) {
return unmarshal(data, dest)
}


// native bindings
func writeStderr(p []byte) (n int, err error)
func writeStdout(p []byte) (n int, err error)
Expand Down

0 comments on commit d01b08e

Please sign in to comment.