Percolation/Bond percolation: Difference between revisions

Content added Content deleted
m (→‎{{header|Go}}: User new and more efficient strings.Builder)
Line 417: Line 417:


import (
import (
"bytes"
"fmt"
"fmt"
"math/rand"
"math/rand"
"strings"
"time"
"time"
)
)
Line 483: Line 483:


func (g *grid) String() string {
func (g *grid) String() string {
var buf bytes.Buffer
var buf strings.Builder
// Don't really need to call Grow but it helps avoid multiple
// Don't really need to call Grow but it helps avoid multiple
// reallocations if the size is large.
// reallocations if the size is large.
Line 580: Line 580:
p=0.90, 0.000
p=0.90, 0.000
</pre>
</pre>

=={{header|Haskell}}==
=={{header|Haskell}}==
<lang haskell>{-# LANGUAGE OverloadedStrings #-}
<lang haskell>{-# LANGUAGE OverloadedStrings #-}