Skip to main content
deleted 1165 characters in body
Source Link
package main

import (
    "fmt"
    "math"
    "math/rand"
    "os"
    "strconv"
    "math"
)

const size = 21 // Must be odd for symmetry

func main() {
    if len(os.Args) != 2 {
        fmt.Println("Usage: go run snowflake.go <seed>")
        return
    }

    seedStr := os.Args[1]
    seed, err := strconv.ParseInt(seedStr, 10, 64)
    if err != nil {
        fmt.Println("Invalid seed:", err)
        return
    }

    // Create a new random source with the seed
    source := rand.NewSource(seed)
    rng := rand.New(source)

    // Create a grid
    grid := make([][]rune, size)
    for i := range grid {
        grid[i] = make([]rune, size)
        for j := range grid[i] {
            grid[i][j] = ' '
        }
    }

    // ASCII characters for snowflake variety
    snowChars := []rune{'*', '•', '○''+', '◦''.', '·''\'', '+'':', '×''o'}

    // Function to set symmetric positions
    setPixel := func(x, y int, char rune) {
        /center := size / Use2
 8-way symmetry for realistic snowflake pattern  relX, relY := x-center, y-center

        positions := [8][2]int{
            {xcenter + relX, ycenter + relY}, {sizecenter - 1relX, -center x,+ yrelY},
            {x,center size+ -relX, 1center - yrelY}, {size - 1center - xrelX, size - 1center - yrelY},
            {ycenter + relY, xcenter + relX}, {sizecenter - 1relY, -center y,+ xrelX},
            {y,center size+ -relY, 1center - xrelX}, {size - 1center - yrelY, size - 1center - xrelX},
        }
 
        for _, p := range positions {
            if p[0] >= 0 && p[0] < size && p[1] >= 0 && p[1] < size {
                grid[p[0]][p[1]] = char
            }
        }
    }

    center := size / 2
    
    // Generate main branches (6-fold symmetry)
    for branch := 0; branch < 6; branch++ {
        angle := float64(branch * 60 // 6 main branches
        )
        // Main branch line
        for radius := 1; radius < center; radius++ {
            if rng.Float64() < 0.8 { // probability of placing character
                x := center + int(math.Round(float64(radius)*cos(angle)))
                y := center + int(math.Round(float64(radius)*sin(angle)))
                char := snowChars[rng.Intn(len(snowChars))]
                setPixel(x, y, char)
            }
 
            
            // Add side branches
            if radius > 2 && rng.Float64() < 0.4 {
                for sideAngle_, sideAngleOffset := anglerange []float64{-60, 30;60} sideAngle{
 <= angle + 30;                sideAngle +=:= 15angle {+ sideAngleOffset
                    sideRadius := float64(radius) / 2.5
                    if sideRadius > 0 && rng.Float64() < 0.61 {
                        x := center + int(math.Round(float64(sideRadiusradius)*cos(angle) - sideRadius*cos(sideAngle)))
                        y := center + int(math.Round(float64(sideRadiusradius)*sin(angle) - sideRadius*sin(sideAngle)))
                        char := snowChars[rng.Intn(len(snowChars))]
                        setPixel(x, y, char)
                    }
                }
            }
        }
    }
    
    // Add some random detail points
    for i := 0; i < center;size*2; i++ {
        if rng.Float64() < 0.3 {
            radius := rng.Intn(center-21) + 21
            angle := float64(rng.Intn(360))
            x := center + int(math.Round(float64(radius)*cos(angle)))
            y := center + int(math.Round(float64(radius)*sin(angle)))
            char := snowChars[rng.Intn(len(snowChars))]
            setPixel(x, y, char)
        }
    }

    // Draw the center
    grid[center][center] = '*'

    // Print the seed header
    fmt.Printf("--- (Seed: %d) ---\n", seed)
    
    // Print the snowflake
    for i := 0; i < size; i++ {
        for j := 0; j < size; j++ {
            fmt.Printf("%c", grid[i][j])
        }
        fmt.Println()
    }
}

func sin(deg int) float64 {
    return math.Sin(float64(deg) * math.Pi / 180)
}

func cos(deg int) float64 {
    return math.Cos(float64(deg) * math.Pi / 180)
}  if radius > 2 && rng.Float64() < 0.4 {
                for sideAngle := angle - 30; sideAngle <= angle + 30; sideAngle += 15 {
                    sideRadius := radius / 2
                    if sideRadius > 0 && rng.Float64() < 0.6 {
                        x := center + int(float64(sideRadius)*cos(sideAngle))
                        y := center + int(float64(sideRadius)*sin(sideAngle))
                        char := snowChars[rng.Intn(len(snowChars))]
                        setPixel(x, y, char)
                    }
                }
            }
        }
    }
    
    // Add some random detail points
    for i := 0; i < center; i++ {
        if rng.Float64() < 0.3 {
            radius := rng.Intn(center-2) + 2
            angle := rng.Intn(360)
            x := center + int(float64(radius)*cos(angle))
            y := center + int(float64(radius)*sin(angle))
            char := snowChars[rng.Intn(len(snowChars))]
            setPixel(x, y, char)
        }
    }

    // Draw the center
    grid[center][center] = '*'

    // Print the snowflake
    for i := 0; i < size; i++ {
        for j := 0; j < size; j++ {
            fmt.Printf("%c""%c ", grid[i][j]) /
        }
        fmt.Println()
    }
}

func sin(deg intfloat64) float64 {
    return math.Sin(float64(deg) * math.Pi / 180)
}

func cos(deg intfloat64) float64 {
    return math.Cos(float64(deg) * math.Pi / 180)
}
--- (Seed: 123) ---

          ·
        × + ×o
      +   + ' o  + * o . o *   o '
      •×    ו  :     . : .     :
          : o .   * * *   . o :
   +• '  · :   * + ·. o o •+
o . + * ×○  ○×+×○:  ○× '
  ×  o ·○•◦·◦•○·: o * ×
  + + : : : + +   * ×◦···◦×o : o
 ·++• ++··*··++ •++·     . + + ' + : . : + ' + + .
    *   ×◦···◦×  . + + * + * + * + + .     *
  ×  o ·○•◦·◦•○·. * o : ×: + o ' o + : : o * . o
  o . ×○: * ○×+×○o : ○×. * ' * ' * . : o * : . o
   +• o . ·* o : : + ·o ' o •++ : : o * . o
    *     . + + * + * + * + + •×.    ו *
        . + + ' + : . : + ' + + .
    o : o * ×  + ×+ : : : + +   * o : o
    '   :   * + ·. o o o . + *   :   '
          : o .   * * *   . o :
            :     . : .     :
          ' o   * o . o *   o '
                    o

--- (Seed: 1024) ---

          *          o
          * o     : + :     o *
      *○  ×  ○*  : o : * + * : o :
       ·  · . + ·+ : : o : : + + .
   ○* *   .   o ' . + * + . *○' o   .   *
   ○· o +×·×+: + ·○o   ' + ' : ' + '   o + : o
      •+×○◦○×+•o + ' '   + : : : +   ' ' + o
      : ×○•◦•○×: . + + ' ' : ' ' + + . : :
 **○×·+·◦◦*◦◦·+·×○**   : * : + ' : ' : * : ' : ' + : * :
  o + + o * : : : ×○•◦•○×* * * : : : * o + + o
    : * •+×○◦○×+•: + ' : ' : * : ' : ' + : * :
   ○·  +×·×+ : ·○: . + + ' ' : ' ' + + . : :
   ○*   o + ' '  *○ + : : : +   ' ' + o
    o : + ·o  · ' ·+ ' : ' + '   o + : o
    *  *○ . ×  ○*o ' . + * + . ' o   .   *
          . + + : : o : : + + .
            : o : * + * : o :
          * o     : + :     o *
                    o

--- (Seed: 16384) ---

                    +
          *: +   . o . o .   + :
      ·      + +  · o o o   + +
      ×*  . ' + + * : ' : * + + ' .
    :   ○•◦○◦•○'   : o . ' ' ' . o :   '   :
   ·× + + + :   * * + . + * ×·*   : + + +
    *○  ◦+◦+◦+ + ○*o * o o ' ' ' o o * o + +
    . ••◦○◦+◦○◦••  * . * o . . * . . o * . *   .
    o o +◦×·×◦+: ' + ' . . + . . ' + ' : o o
 ○*+*○+◦+·*·+◦+○*+*○ + . o ' ' . ' * + * + * ' . ' ' o . +
    o o +◦×·×◦+: ' + ' . . + . . ' + ' : o o
    . ••◦○◦+◦○◦••  * . * o . . * . . o * . *   .
    *○  ◦+◦+◦+ + ○*o * o o ' ' ' o o * o + +
   ·× + + + :   * * + . + * ×·*   : + + +
    :   ○•◦○◦•○'   : o . ' ' ' . o :   '   :
      ×*  . ' + + * : ' : * + + ' .
      ·      + +  · o o o   + +
          *: +   . o . o .   + :
                    +
package main

import (
    "fmt"
    "math/rand"
    "os"
    "strconv"
    "math"
)

const size = 21 // Must be odd for symmetry

func main() {
    if len(os.Args) != 2 {
        fmt.Println("Usage: go run snowflake.go <seed>")
        return
    }

    seedStr := os.Args[1]
    seed, err := strconv.ParseInt(seedStr, 10, 64)
    if err != nil {
        fmt.Println("Invalid seed:", err)
        return
    }

    // Create a new random source with the seed
    source := rand.NewSource(seed)
    rng := rand.New(source)

    // Create a grid
    grid := make([][]rune, size)
    for i := range grid {
        grid[i] = make([]rune, size)
        for j := range grid[i] {
            grid[i][j] = ' '
        }
    }

    // ASCII characters for snowflake variety
    snowChars := []rune{'*', '•', '○', '◦', '·', '+', '×'}

    // Function to set symmetric positions
    setPixel := func(x, y int, char rune) {
        // Use 8-way symmetry for realistic snowflake pattern
        positions := [8][2]int{
            {x, y}, {size - 1 - x, y},
            {x, size - 1 - y}, {size - 1 - x, size - 1 - y},
            {y, x}, {size - 1 - y, x},
            {y, size - 1 - x}, {size - 1 - y, size - 1 - x},
        }
        for _, p := range positions {
            if p[0] >= 0 && p[0] < size && p[1] >= 0 && p[1] < size {
                grid[p[0]][p[1]] = char
            }
        }
    }

    center := size / 2
    
    // Generate main branches (6-fold symmetry)
    for branch := 0; branch < 6; branch++ {
        angle := branch * 60 // 6 main branches
        
        // Main branch line
        for radius := 1; radius < center; radius++ {
            if rng.Float64() < 0.8 { // probability of placing character
                x := center + int(float64(radius)*cos(angle))
                y := center + int(float64(radius)*sin(angle))
                char := snowChars[rng.Intn(len(snowChars))]
                setPixel(x, y, char)
            }
            
            // Add side branches
            if radius > 2 && rng.Float64() < 0.4 {
                for sideAngle := angle - 30; sideAngle <= angle + 30; sideAngle += 15 {
                    sideRadius := radius / 2
                    if sideRadius > 0 && rng.Float64() < 0.6 {
                        x := center + int(float64(sideRadius)*cos(sideAngle))
                        y := center + int(float64(sideRadius)*sin(sideAngle))
                        char := snowChars[rng.Intn(len(snowChars))]
                        setPixel(x, y, char)
                    }
                }
            }
        }
    }
    
    // Add some random detail points
    for i := 0; i < center; i++ {
        if rng.Float64() < 0.3 {
            radius := rng.Intn(center-2) + 2
            angle := rng.Intn(360)
            x := center + int(float64(radius)*cos(angle))
            y := center + int(float64(radius)*sin(angle))
            char := snowChars[rng.Intn(len(snowChars))]
            setPixel(x, y, char)
        }
    }

    // Draw the center
    grid[center][center] = '*'

    // Print the seed header
    fmt.Printf("--- (Seed: %d) ---\n", seed)
    
    // Print the snowflake
    for i := 0; i < size; i++ {
        for j := 0; j < size; j++ {
            fmt.Printf("%c", grid[i][j])
        }
        fmt.Println()
    }
}

func sin(deg int) float64 {
    return math.Sin(float64(deg) * math.Pi / 180)
}

func cos(deg int) float64 {
    return math.Cos(float64(deg) * math.Pi / 180)
}  if radius > 2 && rng.Float64() < 0.4 {
                for sideAngle := angle - 30; sideAngle <= angle + 30; sideAngle += 15 {
                    sideRadius := radius / 2
                    if sideRadius > 0 && rng.Float64() < 0.6 {
                        x := center + int(float64(sideRadius)*cos(sideAngle))
                        y := center + int(float64(sideRadius)*sin(sideAngle))
                        char := snowChars[rng.Intn(len(snowChars))]
                        setPixel(x, y, char)
                    }
                }
            }
        }
    }
    
    // Add some random detail points
    for i := 0; i < center; i++ {
        if rng.Float64() < 0.3 {
            radius := rng.Intn(center-2) + 2
            angle := rng.Intn(360)
            x := center + int(float64(radius)*cos(angle))
            y := center + int(float64(radius)*sin(angle))
            char := snowChars[rng.Intn(len(snowChars))]
            setPixel(x, y, char)
        }
    }

    // Draw the center
    grid[center][center] = '*'

    // Print the snowflake
    for i := 0; i < size; i++ {
        for j := 0; j < size; j++ {
            fmt.Printf("%c", grid[i][j])
        }
        fmt.Println()
    }
}

func sin(deg int) float64 {
    return math.Sin(float64(deg) * math.Pi / 180)
}

func cos(deg int) float64 {
    return math.Cos(float64(deg) * math.Pi / 180)
}
--- (Seed: 123) ---

          ·
        × + ×
      +   +   +
      •×    ו
            
   +•   · + ·   •+
    ×○  ○×+×○  ○×
  ×   ·○•◦·◦•○·   ×
       ×◦···◦×
 ·++• ++··*··++ •++·
       ×◦···◦×
  ×   ·○•◦·◦•○·   ×
    ×○  ○×+×○  ○×
   +•   · + ·   •+
                  •×    ו
      +   +   +
        × + ×
          ·

--- (Seed: 1024) ---

          *
         *              
      *○  ×  ○*
       ·  ·  ·
   ○*    +    *○
   ○·  +×·×+  ·○ 
      •+×○◦○×+•
       ×○•◦•○×
 **○×·+·◦◦*◦◦·+·×○**
       ×○•◦•○×
      •+×○◦○×+•
   ○·  +×·×+  ·○ 
   ○*    +    *○
       ·  ·  ·
      *○  ×  ○*
            
         *  
          *
--- (Seed: 16384) ---

          
          *
      ·   +   ·
      ×*  *  
       ○•◦○◦•○
   ·×    +    ×·
    *○  ◦+◦+◦  ○*
     ••◦○◦+◦○◦••
      +◦×·×◦+ 
 ○*+*○+◦+·*·+◦+○*+*○
      +◦×·×◦+ 
     ••◦○◦+◦○◦••
    *○  ◦+◦+◦  ○*
   ·×    +    ×·
       ○•◦○◦•○
      ×*  *  
      ·   +   ·
          *
          
package main

import (
    "fmt"
    "math"
    "math/rand"
    "os"
    "strconv"
)

const size = 21 // Must be odd for symmetry

func main() {
    if len(os.Args) != 2 {
        fmt.Println("Usage: go run snowflake.go <seed>")
        return
    }

    seedStr := os.Args[1]
    seed, err := strconv.ParseInt(seedStr, 10, 64)
    if err != nil {
        fmt.Println("Invalid seed:", err)
        return
    }

    source := rand.NewSource(seed)
    rng := rand.New(source)

    grid := make([][]rune, size)
    for i := range grid {
        grid[i] = make([]rune, size)
        for j := range grid[i] {
            grid[i][j] = ' '
        }
    }

    snowChars := []rune{'*', '+', '.', '\'', ':', 'o'}

    setPixel := func(x, y int, char rune) {
        center := size / 2
        relX, relY := x-center, y-center

        positions := [8][2]int{
            {center + relX, center + relY}, {center - relX, center + relY},
            {center + relX, center - relY}, {center - relX, center - relY},
            {center + relY, center + relX}, {center - relY, center + relX},
            {center + relY, center - relX}, {center - relY, center - relX},
        }
 
        for _, p := range positions {
            if p[0] >= 0 && p[0] < size && p[1] >= 0 && p[1] < size {
                grid[p[0]][p[1]] = char
            }
        }
    }

    center := size / 2

    for branch := 0; branch < 6; branch++ {
        angle := float64(branch * 60)

        for radius := 1; radius < center; radius++ {
            if rng.Float64() < 0.8 { 
                x := center + int(math.Round(float64(radius)*cos(angle)))
                y := center + int(math.Round(float64(radius)*sin(angle)))
                char := snowChars[rng.Intn(len(snowChars))]
                setPixel(x, y, char)
            }
 
            
            if radius > 2 && rng.Float64() < 0.4 {
                for _, sideAngleOffset := range []float64{-60, 60} {
                    sideAngle := angle + sideAngleOffset
                    sideRadius := float64(radius) / 2.5
                    if sideRadius > 1 {
                        x := center + int(math.Round(float64(radius)*cos(angle) - sideRadius*cos(sideAngle)))
                        y := center + int(math.Round(float64(radius)*sin(angle) - sideRadius*sin(sideAngle)))
                        char := snowChars[rng.Intn(len(snowChars))]
                        setPixel(x, y, char)
                    }
                }
            }
        }
    }

    for i := 0; i < size*2; i++ {
        if rng.Float64() < 0.3 {
            radius := rng.Intn(center-1) + 1
            angle := float64(rng.Intn(360))
            x := center + int(math.Round(float64(radius)*cos(angle)))
            y := center + int(math.Round(float64(radius)*sin(angle)))
            char := snowChars[rng.Intn(len(snowChars))]
            setPixel(x, y, char)
        }
    }

    grid[center][center] = '*'

    fmt.Printf("--- (Seed: %d) ---\n", seed)

    for i := 0; i < size; i++ {
        for j := 0; j < size; j++ {
            fmt.Printf("%c ", grid[i][j]) /
        }
        fmt.Println()
    }
}

func sin(deg float64) float64 {
    return math.Sin(deg * math.Pi / 180)
}

func cos(deg float64) float64 {
    return math.Cos(deg * math.Pi / 180)
}
--- (Seed: 123) ---

                    o
          ' o   * o . o *   o '
            :     . : .     :
          : o .   * * *   . o :
    '   :   * + . o o o . + *   :   '
    o : o *   + + : : : + +   * o : o
        . + + ' + : . : + ' + + .
    *     . + + * + * + * + + .     *
    o . * o : : + o ' o + : : o * . o
  o . : * o : . * ' * ' * . : o * : . o
    o . * o : : + o ' o + : : o * . o
    *     . + + * + * + * + + .     *
        . + + ' + : . : + ' + + .
    o : o *   + + : : : + +   * o : o
    '   :   * + . o o o . + *   :   '
          : o .   * * *   . o :
            :     . : .     :
          ' o   * o . o *   o '
                    o

--- (Seed: 1024) ---

                    o
          * o     : + :     o *
            : o : * + * : o :
          . + + : : o : : + + .
    *   .   o ' . + * + . ' o   .   *
    o : + o   ' + ' : ' + '   o + : o
      o + ' '   + : : : +   ' ' + o
      : : . + + ' ' : ' ' + + . : :
    : * : + ' : ' : * : ' : ' + : * :
  o + + o * : : : * * * : : : * o + + o
    : * : + ' : ' : * : ' : ' + : * :
      : : . + + ' ' : ' ' + + . : :
      o + ' '   + : : : +   ' ' + o
    o : + o   ' + ' : ' + '   o + : o
    *   .   o ' . + * + . ' o   .   *
          . + + : : o : : + + .
            : o : * + * : o :
          * o     : + :     o *
                    o

--- (Seed: 16384) ---

                    +
          : +   . o . o .   + :
            + +   o o o   + +
        . ' + + * : ' : * + + ' .
    :   '   : o . ' ' ' . o :   '   :
    + + + :   * * + . + * *   : + + +
      + + o * o o ' ' ' o o * o + +
    .   * . * o . . * . . o * . *   .
    o o : ' + ' . . + . . ' + ' : o o
  + . o ' ' . ' * + * + * ' . ' ' o . +
    o o : ' + ' . . + . . ' + ' : o o
    .   * . * o . . * . . o * . *   .
      + + o * o o ' ' ' o o * o + +
    + + + :   * * + . + * *   : + + +
    :   '   : o . ' ' ' . o :   '   :
        . ' + + * : ' : * + + ' .
            + +   o o o   + +
          : +   . o . o .   + :
                    +
Source Link

Here is my entry, written in Go.

package main

import (
    "fmt"
    "math/rand"
    "os"
    "strconv"
    "math"
)

const size = 21 // Must be odd for symmetry

func main() {
    if len(os.Args) != 2 {
        fmt.Println("Usage: go run snowflake.go <seed>")
        return
    }

    seedStr := os.Args[1]
    seed, err := strconv.ParseInt(seedStr, 10, 64)
    if err != nil {
        fmt.Println("Invalid seed:", err)
        return
    }

    // Create a new random source with the seed
    source := rand.NewSource(seed)
    rng := rand.New(source)

    // Create a grid
    grid := make([][]rune, size)
    for i := range grid {
        grid[i] = make([]rune, size)
        for j := range grid[i] {
            grid[i][j] = ' '
        }
    }

    // ASCII characters for snowflake variety
    snowChars := []rune{'*', '•', '○', '◦', '·', '+', '×'}

    // Function to set symmetric positions
    setPixel := func(x, y int, char rune) {
        // Use 8-way symmetry for realistic snowflake pattern
        positions := [8][2]int{
            {x, y}, {size - 1 - x, y},
            {x, size - 1 - y}, {size - 1 - x, size - 1 - y},
            {y, x}, {size - 1 - y, x},
            {y, size - 1 - x}, {size - 1 - y, size - 1 - x},
        }
        for _, p := range positions {
            if p[0] >= 0 && p[0] < size && p[1] >= 0 && p[1] < size {
                grid[p[0]][p[1]] = char
            }
        }
    }

    center := size / 2
    
    // Generate main branches (6-fold symmetry)
    for branch := 0; branch < 6; branch++ {
        angle := branch * 60 // 6 main branches
        
        // Main branch line
        for radius := 1; radius < center; radius++ {
            if rng.Float64() < 0.8 { // probability of placing character
                x := center + int(float64(radius)*cos(angle))
                y := center + int(float64(radius)*sin(angle))
                char := snowChars[rng.Intn(len(snowChars))]
                setPixel(x, y, char)
            }
            
            // Add side branches
            if radius > 2 && rng.Float64() < 0.4 {
                for sideAngle := angle - 30; sideAngle <= angle + 30; sideAngle += 15 {
                    sideRadius := radius / 2
                    if sideRadius > 0 && rng.Float64() < 0.6 {
                        x := center + int(float64(sideRadius)*cos(sideAngle))
                        y := center + int(float64(sideRadius)*sin(sideAngle))
                        char := snowChars[rng.Intn(len(snowChars))]
                        setPixel(x, y, char)
                    }
                }
            }
        }
    }
    
    // Add some random detail points
    for i := 0; i < center; i++ {
        if rng.Float64() < 0.3 {
            radius := rng.Intn(center-2) + 2
            angle := rng.Intn(360)
            x := center + int(float64(radius)*cos(angle))
            y := center + int(float64(radius)*sin(angle))
            char := snowChars[rng.Intn(len(snowChars))]
            setPixel(x, y, char)
        }
    }

    // Draw the center
    grid[center][center] = '*'

    // Print the seed header
    fmt.Printf("--- (Seed: %d) ---\n", seed)
    
    // Print the snowflake
    for i := 0; i < size; i++ {
        for j := 0; j < size; j++ {
            fmt.Printf("%c", grid[i][j])
        }
        fmt.Println()
    }
}

func sin(deg int) float64 {
    return math.Sin(float64(deg) * math.Pi / 180)
}

func cos(deg int) float64 {
    return math.Cos(float64(deg) * math.Pi / 180)
}  if radius > 2 && rng.Float64() < 0.4 {
                for sideAngle := angle - 30; sideAngle <= angle + 30; sideAngle += 15 {
                    sideRadius := radius / 2
                    if sideRadius > 0 && rng.Float64() < 0.6 {
                        x := center + int(float64(sideRadius)*cos(sideAngle))
                        y := center + int(float64(sideRadius)*sin(sideAngle))
                        char := snowChars[rng.Intn(len(snowChars))]
                        setPixel(x, y, char)
                    }
                }
            }
        }
    }
    
    // Add some random detail points
    for i := 0; i < center; i++ {
        if rng.Float64() < 0.3 {
            radius := rng.Intn(center-2) + 2
            angle := rng.Intn(360)
            x := center + int(float64(radius)*cos(angle))
            y := center + int(float64(radius)*sin(angle))
            char := snowChars[rng.Intn(len(snowChars))]
            setPixel(x, y, char)
        }
    }

    // Draw the center
    grid[center][center] = '*'

    // Print the snowflake
    for i := 0; i < size; i++ {
        for j := 0; j < size; j++ {
            fmt.Printf("%c", grid[i][j])
        }
        fmt.Println()
    }
}

func sin(deg int) float64 {
    return math.Sin(float64(deg) * math.Pi / 180)
}

func cos(deg int) float64 {
    return math.Cos(float64(deg) * math.Pi / 180)
}

And here are some test runs:

--- (Seed: 123) ---

          ·
        × + ×
      +   +   +
      •×  •  ו
       ○     ○
   +•   · + ·   •+
    ×○  ○×+×○  ○×
  ×   ·○•◦·◦•○·   ×
       ×◦···◦×
 ·++• ++··*··++ •++·
       ×◦···◦×
  ×   ·○•◦·◦•○·   ×
    ×○  ○×+×○  ○×
   +•   · + ·   •+
       ○     ○
      •×  •  ו
      +   +   +
        × + ×
          ·

--- (Seed: 1024) ---

          *
       •  *  •
      ○   ○   ○
      *○  ×  ○*
       ·  ·  ·
   ○*   • + •   *○
  • ○·  +×·×+  ·○ •
      •+×○◦○×+•
       ×○•◦•○×
 **○×·+·◦◦*◦◦·+·×○**
       ×○•◦•○×
      •+×○◦○×+•
  • ○·  +×·×+  ·○ •
   ○*   • + •   *○
       ·  ·  ·
      *○  ×  ○*
      ○   ○   ○
       •  *  •
          *
--- (Seed: 16384) ---

          ○
          *
      ·   +   ·
      ×*  *  *×
       ○•◦○◦•○
   ·×   • + •   ×·
    *○  ◦+◦+◦  ○*
     ••◦○◦+◦○◦••
     ◦ +◦×·×◦+ ◦
 ○*+*○+◦+·*·+◦+○*+*○
     ◦ +◦×·×◦+ ◦
     ••◦○◦+◦○◦••
    *○  ◦+◦+◦  ○*
   ·×   • + •   ×·
       ○•◦○◦•○
      ×*  *  *×
      ·   +   ·
          *
          ○