25 lines
300 B
Go
25 lines
300 B
Go
|
|
package main
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
"math/rand"
|
||
|
|
"time"
|
||
|
|
)
|
||
|
|
|
||
|
|
func main() {
|
||
|
|
t := 0
|
||
|
|
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||
|
|
rows := r.Intn(100)
|
||
|
|
for x := 1; x <= rows; x++ {
|
||
|
|
if x > rows/2 {
|
||
|
|
t--
|
||
|
|
} else {
|
||
|
|
t++
|
||
|
|
}
|
||
|
|
for y := 0; y < t; y++ {
|
||
|
|
fmt.Print("*")
|
||
|
|
}
|
||
|
|
fmt.Print("\n")
|
||
|
|
}
|
||
|
|
}
|