Balanced brackets: Difference between revisions

→‎{{header|Go}}: library changes
(Added Befunge check of whether a string is balanced)
(→‎{{header|Go}}: library changes)
Line 911:
import (
"fmt"
"math/rand"
"strings"
"time"
Line 917:
 
func init() {
rand.Seed(time.NanosecondsNow().UnixNano())
}
 
Line 945:
open--
default:
panicfmt.Println("Unexpected content. Generator fail?")
return
}
}
Line 964 ⟶ 965:
<pre>
: OK
][]: NOT OK
[][][: NOT OK
][[][]][[: NOT OK
[[][][]][[[: NOT OK
]][][][][[][: NOT OK
][][][]][[][]]]]: NOT OK
[[]][]]][][[]]][]: NOT OK
]][[[][][]][]]][][]: NOT OK
][[]]]][[][]][][[]][[: NOT OK
(): panic: Unexpected content. Generator fail?
</pre>
 
1,707

edits