From 8a41d4bae5902e52bde0fc9fae10af581160c77e Mon Sep 17 00:00:00 2001 From: Maxine Filcher Date: Fri, 8 Jan 2021 11:57:13 -0800 Subject: [PATCH] added small hearts --- heartGenie.go | 96 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 82 insertions(+), 14 deletions(-) diff --git a/heartGenie.go b/heartGenie.go index e39d110..4f20cab 100644 --- a/heartGenie.go +++ b/heartGenie.go @@ -12,6 +12,17 @@ var heartSpread = flag.Int("s", 10, "random number spread") var words = flag.String("w", "", "words to be displayed") // shape | WS calculation + +/* + @@ @@ 6 + 2 + @ @ @ @ 5 + 2 + 1 + 2 + @ @ 6 + 5 + @ @ 7 + 3 + @ @ 8 +1 + @ 9 + +*/ + /* @@@ @@@ 7 + 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) { for i := 0; i <= 16+x; 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 func randomMod() int { rand.Seed(time.Now().UnixNano()) min := 0 - max := 40 + max := 59 return (rand.Intn(max-min+1) + min) } @@ -125,16 +194,15 @@ func pos(x int, y int) (int, int) { //xO := x + randomMod() return x + randomMod(), y - } func whSp(in int) { - x, y := pos(in, 7) + x, y := pos(in, 6) switch y { case 6: - //small + smHeart(x) case 7: medHeart(x)