forked from freqy/randomHearts
added small hearts
This commit is contained in:
parent
6fac8ccc40
commit
8a41d4bae5
@ -12,6 +12,17 @@ var heartSpread = flag.Int("s", 10, "random number spread")
|
|||||||
var words = flag.String("w", "", "words to be displayed")
|
var words = flag.String("w", "", "words to be displayed")
|
||||||
|
|
||||||
// shape | WS calculation
|
// shape | WS calculation
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ @@ 6 + 2
|
||||||
|
@ @ @ @ 5 + 2 + 1 + 2
|
||||||
|
@ @ 6 + 5
|
||||||
|
@ @ 7 + 3
|
||||||
|
@ @ 8 +1
|
||||||
|
@ 9
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@@ @@@ 7 + 3
|
@@@ @@@ 7 + 3
|
||||||
@ @ @ @ 6 + 3 + 1 + 3
|
@ @ @ @ 6 + 3 + 1 + 3
|
||||||
@ -37,16 +48,6 @@ var words = flag.String("w", "", "words to be displayed")
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
@@ @@ 6 + 2
|
|
||||||
@ @ @ @ 5 + 2 + 1 + 2
|
|
||||||
@ @ 6 + 5
|
|
||||||
@ @ 7 + 3
|
|
||||||
@ @ 8 +1
|
|
||||||
@ 9
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
func medHeart(x int) {
|
func medHeart(x int) {
|
||||||
for i := 0; i <= 16+x; i++ {
|
for i := 0; i <= 16+x; i++ {
|
||||||
switch i {
|
switch i {
|
||||||
@ -109,11 +110,79 @@ func medHeart(x int) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func smHeart(x int) {
|
||||||
|
//First Line
|
||||||
|
for i := 0; i <= 13+x; i++ {
|
||||||
|
switch i {
|
||||||
|
default:
|
||||||
|
fmt.Print(" ")
|
||||||
|
case x + 7, x + 8, x + 12:
|
||||||
|
fmt.Print("@")
|
||||||
|
case x + 13:
|
||||||
|
fmt.Println("@")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Second Line
|
||||||
|
for i := 0; i <= 14+x; i++ {
|
||||||
|
switch i {
|
||||||
|
default:
|
||||||
|
fmt.Print(" ")
|
||||||
|
case x + 6, x + 9, x + 11:
|
||||||
|
fmt.Print("@")
|
||||||
|
case x + 14:
|
||||||
|
fmt.Println("@")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Third Line
|
||||||
|
for i := 0; i <= 13+x; i++ {
|
||||||
|
switch i {
|
||||||
|
default:
|
||||||
|
fmt.Print(" ")
|
||||||
|
case x + 7:
|
||||||
|
fmt.Print("@")
|
||||||
|
case x + 13:
|
||||||
|
fmt.Println("@")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Fourth Line
|
||||||
|
for i := 0; i <= 12+x; i++ {
|
||||||
|
switch i {
|
||||||
|
default:
|
||||||
|
fmt.Print(" ")
|
||||||
|
case x + 8:
|
||||||
|
fmt.Print("@")
|
||||||
|
case x + 12:
|
||||||
|
fmt.Println("@")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Fifth Line
|
||||||
|
for i := 0; i <= 11+x; i++ {
|
||||||
|
switch i {
|
||||||
|
default:
|
||||||
|
fmt.Print(" ")
|
||||||
|
case x + 9:
|
||||||
|
fmt.Print("@")
|
||||||
|
case x + 11:
|
||||||
|
fmt.Println("@")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Sixth Line
|
||||||
|
for i := 0; i <= 10+x; i++ {
|
||||||
|
switch i {
|
||||||
|
default:
|
||||||
|
fmt.Print(" ")
|
||||||
|
case x + 10:
|
||||||
|
fmt.Println("@")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//rand num to modify x position
|
//rand num to modify x position
|
||||||
func randomMod() int {
|
func randomMod() int {
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
min := 0
|
min := 0
|
||||||
max := 40
|
max := 59
|
||||||
return (rand.Intn(max-min+1) + min)
|
return (rand.Intn(max-min+1) + min)
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -125,16 +194,15 @@ func pos(x int, y int) (int, int) {
|
|||||||
//xO := x + randomMod()
|
//xO := x + randomMod()
|
||||||
|
|
||||||
return x + randomMod(), y
|
return x + randomMod(), y
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func whSp(in int) {
|
func whSp(in int) {
|
||||||
|
|
||||||
x, y := pos(in, 7)
|
x, y := pos(in, 6)
|
||||||
|
|
||||||
switch y {
|
switch y {
|
||||||
case 6:
|
case 6:
|
||||||
//small
|
smHeart(x)
|
||||||
case 7:
|
case 7:
|
||||||
medHeart(x)
|
medHeart(x)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user